Skip to content

Commit

Permalink
Merge pull request #679 from PaulDance/deprecate-id
Browse files Browse the repository at this point in the history
Fully deprecate `objc2::rc::Id`
  • Loading branch information
madsmtm authored Dec 12, 2024
2 parents 8487618 + cb335af commit 6abcdbe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 8 additions & 2 deletions crates/objc2/src/rc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ pub use self::allocated_partial_init::{Allocated, PartialInit};
pub use self::autorelease::{
autoreleasepool, autoreleasepool_leaking, AutoreleasePool, AutoreleaseSafe,
};
pub use self::retained::{Id, Retained};
// Re-export `Id` for backwards compatibility, but still mark it as deprecated.
#[allow(deprecated)]
pub use self::retained::Id;
pub use self::retained::Retained;
pub use self::retained_traits::{DefaultRetained, RetainedFromIterator, RetainedIntoIterator};
#[cfg(test)]
pub(crate) use self::test_object::{RcTestObject, ThreadTestData};
pub use self::weak::{Weak, WeakId};
pub use self::weak::Weak;
// Same as above.
#[allow(deprecated)]
pub use self::weak::WeakId;
7 changes: 2 additions & 5 deletions crates/objc2/src/rc/retained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ pub struct Retained<T: ?Sized> {

/// Short type-alias to [`Retained`].
///
/// This type is soft-deprecated, and will be fully deprecated in `v0.6.0`,
/// see [#617].
///
/// [`Retained<T>`]: Retained
/// [#617]: https://github.com/madsmtm/objc2/issues/617
/// This is fully deprecated since `v0.6.0`, use [`Retained`] instead.
#[deprecated(since = "0.6.0", note = "Renamed to `Retained`.")]
pub type Id<T> = Retained<T>;

impl<T: ?Sized> Retained<T> {
Expand Down
3 changes: 2 additions & 1 deletion crates/objc2/src/rc/weak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ pub struct Weak<T: ?Sized> {
item: PhantomData<Retained<T>>,
}

/// Soft-deprecated type-alias to [`Weak`].
/// Fully-deprecated type-alias to [`Weak`].
#[deprecated(since = "0.6.0", note = "Renamed to `Weak`.")]
pub type WeakId<T> = Weak<T>;

impl<T: Message> Weak<T> {
Expand Down

0 comments on commit 6abcdbe

Please sign in to comment.