You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current state of the repo, yes. However, the plan is to use num-traits and num-derive to implement some of the config stuff, which would violate that.
CTRE added a method to get all the current config values from a device in Phoenix v5.7. Unfortunately they use the ConfigGetParam method to do so, so they cast doubles to enums. Obviously there is no sane/safe way to do this in Rust core without a lot of duplicate code, so I've opted to use num_traits::FromPrimitive to convert an f64 to an enum.
I don't want to add more From impls because they wouldn't follow the expected semantics of From.
See https://rust-lang-nursery.github.io/api-guidelines/ for details.
as_
,to_
,into_
conventions (C-CONV)Methods on collections that produce iterators followiter
,iter_mut
,into_iter
(C-ITER)Iterator type names match the methods that produce them (C-ITER-TY)Copy
,Clone
Eq
,PartialEq
Ord
,PartialOrd
Hash
Debug
Display
Default
From
,AsRef
,AsMut
(C-CONV-TRAITS)Collections implementFromIterator
andExtend
(C-COLLECT)Serialize
,Deserialize
(C-SERDE)TrajectoryPoint
MotionProfileStatus
Send
andSync
where possible (C-SEND-SYNC)Hex
,Octal
,Binary
formatting (C-NUM-FMT)Generic reader/writer functions takeR: Read
andW: Write
by value (C-RW-VALUE)Item macros work anywhere that items are allowed (C-ANYWHERE)Item macros support visibility specifiers (C-MACRO-VIS)Type fragments are flexible (C-MACRO-TY)?
, nottry!
, notunwrap
(C-QUESTION-MARK)readme, keywords, categories
Smart pointers do not add inherent methods (C-SMART-PTR)Operator overloads are unsurprising (C-OVERLOAD)Only smart pointers implementDeref
andDerefMut
(C-DEREF)Functions minimize assumptions about parameters by using generics (C-GENERIC)bool
orOption
(C-CUSTOM-TYPE)Types for a set of flags arebitflags
, not enums (C-BITFLAG)TrajectoryPoint
?Destructors never fail (C-DTOR-FAIL)Destructors that may block have alternatives (C-DTOR-BLOCK)Debug
(C-DEBUG)Debug
representation is never empty (C-DEBUG-NONEMPTY)for users of CTRE hardware, and FRC teams.
The text was updated successfully, but these errors were encountered: