-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
ObjectId currently has three constructors: new, with_bytes, and with_string. The latter use somewhat nonstandard naming for what they do:
- with_bytes is a conversion, so it should probably be from_bytes and/or have a From<_> impl.
- with_string accepts an &str, so it should indicate that. Also, given that it is failable, it could imply that via a prefix like parse instead of with
To remedy this, we should follow uuid::Uuid's API and update the various constructors to be more standard. This is in line with the C-CONV-TRAITS and C-CTOR Rust API guidelines.
- is depended on by
-
RUST-765 Ensure API follows Rust API Guidelines
- Closed