Skip to content

Commit 01f08a7

Browse files
committed
Remove WeakId TryFrom impl
1 parent b4dda04 commit 01f08a7

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

crates/objc2/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
9898

9999
let obj: Id<NSObject> = unsafe { msg_send_id![NSObject::class(), new] };
100100
```
101+
* **BREAKING**: Removed `impl<T> TryFrom<WeakId<T>> for Id<T>` impl since it
102+
did not have a proper error type, making it less useful than just using
103+
`WeakId::load`.
101104

102105

103106
## 0.3.0-beta.5 - 2023-02-07

crates/objc2/src/rc/weak_id.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,6 @@ impl<T: IsIdCloneable> From<Id<T>> for WeakId<T> {
186186
}
187187
}
188188

189-
impl<T: IsRetainable> TryFrom<WeakId<T>> for Id<T> {
190-
type Error = ();
191-
fn try_from(weak: WeakId<T>) -> Result<Self, ()> {
192-
weak.load().ok_or(())
193-
}
194-
}
195-
196189
#[cfg(test)]
197190
mod tests {
198191
use core::mem;

0 commit comments

Comments
 (0)