Closed madsmtm closed 1 year ago
Also, investigate using ToOwned
.
I think we want to keep breaking C-SMART-PTR for Id::autorelease
because that is a method name that only ever makes sense on Id
#![warn(missing_debug_implementations)]
can be helpful here
We should also check all traits for whether they provide correct blanket impls (impl<T: Trait> Trait for &T
, Box<T>
, ...)
I will consider most of this guideline as not really applicable to icrate
, since most of the design questions there are handled by Apple, and not us.
Naming decisions in icrate
are explicitly moved to https://github.com/madsmtm/objc2/issues/284
I consider this basically done now, remaining parts are tracked in the linked issues
Rust API Guidelines Checklist
as_
,to_
,into_
conventions (C-CONV)iter
,iter_mut
,into_iter
(C-ITER)Copy
,Clone
,Eq
,PartialEq
,Ord
,PartialOrd
,Hash
,Debug
,Display
,Default
From
,AsRef
,AsMut
(C-CONV-TRAITS)FromIterator
andExtend
(C-COLLECT)Serialize
,Deserialize
(C-SERDE)Send
andSync
where possible (C-SEND-SYNC)Hex
,Octal
,Binary
formatting (C-NUM-FMT)Bool
, just as we don't implementPartialEq
for thatR: Read
andW: Write
by value (C-RW-VALUE)?
, nottry!
, notunwrap
(C-QUESTION-MARK)Deref
andDerefMut
(C-DEREF)objc2::runtime
, and that would mostly be interesting after it's easier to use&CStr
, e.g. after https://github.com/rust-lang/rust/issues/105723 (tracked in https://github.com/madsmtm/objc2/issues/429)bool
orOption
(C-CUSTOM-TYPE)bitflags
, not enums (C-BITFLAG)Debug
(C-DEBUG)Debug
representation is never empty (C-DEBUG-NONEMPTY)