Skip to content

Commit

Permalink
Rename objc-encode -> objc2_encode
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 8, 2021
1 parent 240cb19 commit 941d772
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion objc2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ unstable_autoreleasesafe = []
[dependencies]
malloc_buf = "1.0"
objc2_sys = { path = "../objc2_sys" }
objc-encode = { path = "../objc2_encode", version = "1.0" }
objc2_encode = { path = "../objc2_encode" }
objc_exception = { path = "../objc2_exception", version = "0.1", optional = true }
2 changes: 1 addition & 1 deletion objc2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extern "C" {}
#[doc = include_str!("../../README.md")]
extern "C" {}

pub use objc_encode::{Encode, EncodeArguments, Encoding, RefEncode};
pub use objc2_encode::{Encode, EncodeArguments, Encoding, RefEncode};

pub use crate::message::{Message, MessageArguments, MessageError};

Expand Down
2 changes: 1 addition & 1 deletion objc2_block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exclude = [
]

[dependencies]
objc-encode = { path = "../objc2_encode", version = "1.1.0" }
objc2_encode = { path = "../objc2_encode" }

[dev-dependencies]
objc_test_utils = { path = "../objc2_test_utils", version = "0.0" }
2 changes: 1 addition & 1 deletion objc2_block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use core::ops::{Deref, DerefMut};
use core::ptr;
use std::os::raw::{c_int, c_ulong};

use objc_encode::{Encode, EncodeArguments, Encoding, RefEncode};
use objc2_encode::{Encode, EncodeArguments, Encoding, RefEncode};

// TODO: Replace with `objc::Class`
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions objc2_encode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "objc-encode"
name = "objc2_encode"
# Remember to update html_root_url in lib.rs and README.md
version = "1.1.0"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
Expand All @@ -15,5 +15,5 @@ categories = [
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc-encode/"
documentation = "https://docs.rs/objc2_encode/"
license = "MIT"
16 changes: 8 additions & 8 deletions objc2_encode/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `objc-encode` - Objective-C type-encoding in Rust
# `objc2_encode` - Objective-C type-encoding in Rust

[![Latest version](https://badgen.net/crates/v/objc-encode)](https://crates.io/crates/objc-encode)
[![Latest version](https://badgen.net/crates/v/objc2_encode)](https://crates.io/crates/objc2_encode)
[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt)
[![Documentation](https://docs.rs/objc-encode/badge.svg)](https://docs.rs/objc-encode/)
[![Documentation](https://docs.rs/objc2_encode/badge.svg)](https://docs.rs/objc2_encode/)
[![CI Status](https://github.com/madsmtm/objc2/workflows/CI/badge.svg)](https://github.com/madsmtm/objc2/actions)

The Objective-C directive `@encode` encodes types as strings for usage in
Expand All @@ -23,7 +23,7 @@ just use that crate.
Implementing `Encode` and `RefEncode`:

```rust
use objc_encode::{Encode, Encoding, RefEncode};
use objc2_encode::{Encode, Encoding, RefEncode};

#[repr(C)]
struct MyObject {
Expand Down Expand Up @@ -51,15 +51,15 @@ An `Encoding` can be compared with an encoding string from the Objective-C
runtime:

```rust
use objc_encode::Encode;
use objc2_encode::Encode;
assert!(&i32::ENCODING == "i");
```

`Encoding` implements `Display` as its string representation. This can be
generated conveniently through the `to_string` method:

```rust
use objc_encode::Encode;
use objc2_encode::Encode;
assert_eq!(i32::ENCODING.to_string(), "i");
```

Expand All @@ -69,7 +69,7 @@ See the [`examples`] folder for more complex usage.

```toml
[dependencies]
objc-encode = "1.1.0"
objc2_encode = "1.1.0"
```

# License
Expand All @@ -79,5 +79,5 @@ This project is licensed under the MIT license, see [`../LICENSE.txt`].
Work is in progress to make it dual-licensed under the Apache License
(Version 2.0) as well.

[`examples`]: https://github.com/madsmtm/objc2/tree/master/objc_encode/examples
[`examples`]: https://github.com/madsmtm/objc2/tree/master/objc2_encode/examples
[`../LICENSE.txt`]: https://github.com/madsmtm/objc2/blob/master/LICENSE.txt
2 changes: 1 addition & 1 deletion objc2_encode/examples/core_graphics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use objc_encode::{Encode, Encoding};
use objc2_encode::{Encode, Encoding};

#[cfg(target_pointer_width = "32")]
type CGFloat = f32;
Expand Down
2 changes: 1 addition & 1 deletion objc2_encode/examples/ns_string.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use objc_encode::{Encode, Encoding, RefEncode};
use objc2_encode::{Encode, Encoding, RefEncode};

/// We don't know the size of NSString, so we can only hold pointers to it.
///
Expand Down
2 changes: 1 addition & 1 deletion objc2_encode/examples/ns_uinteger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Note that in this case `NSUInteger` could actually just be a type alias
//! for `usize`.
use objc_encode::{Encode, Encoding, RefEncode};
use objc2_encode::{Encode, Encoding, RefEncode};

#[repr(transparent)]
struct NSUInteger {
Expand Down
2 changes: 1 addition & 1 deletion objc2_encode/examples/opaque_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Implementing `RefEncode` for `NSDecimal`.
use objc_encode::{Encoding, RefEncode};
use objc2_encode::{Encoding, RefEncode};

/// We choose in this case to represent `NSDecimal` as an opaque struct
/// (and in the future as an `extern type`) because we don't know much
Expand Down
6 changes: 3 additions & 3 deletions objc2_encode/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::Encoding;
/// Implementing for a struct:
///
/// ```
/// # use objc_encode::{Encode, Encoding, RefEncode};
/// # use objc2_encode::{Encode, Encoding, RefEncode};
/// # use core::ffi::c_void;
/// #
/// #[repr(C)]
Expand Down Expand Up @@ -114,7 +114,7 @@ pub unsafe trait RefEncode {
///
/// This is usually implemented either as an object pointer:
/// ```
/// # use objc_encode::{Encoding, RefEncode};
/// # use objc2_encode::{Encoding, RefEncode};
/// # #[repr(C)]
/// # struct MyObject {
/// # _priv: [u8; 0],
Expand All @@ -127,7 +127,7 @@ pub unsafe trait RefEncode {
/// Or as a pointer to the type, delegating the rest to the [`Encode`]
/// implementation:
/// ```
/// # use objc_encode::{Encode, Encoding, RefEncode};
/// # use objc2_encode::{Encode, Encoding, RefEncode};
/// # #[repr(transparent)]
/// # struct MyType(i32);
/// # unsafe impl Encode for MyType {
Expand Down
2 changes: 1 addition & 1 deletion objc2_encode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![no_std]
#![warn(missing_docs)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc-encode/1.1.0")]
#![doc(html_root_url = "https://docs.rs/objc2_encode/1.1.0")]

#[cfg(doctest)]
#[doc = include_str!("../README.md")]
Expand Down

0 comments on commit 941d772

Please sign in to comment.