4

Convert `newtype_index` to a proc macro by Aaron1011 · Pull Request #93878 · rus...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/93878
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

///

/// - The `From` impls are the preferred way. So you can do

/// `S::from(v)` with a `usize` or `u32`. And you can convert back

/// to an integer with `u32::from(s)`.

I know this comment is pre-existing, but while we're here: is this advice correct? I personally prefer S::new(v) and s.index(), and I feel like I've seen those forms more often.

Copy link

Member

Author

@Aaron1011 Aaron1011 16 days ago

I'm not sure - I think this could be dealt with in a follow-up issue, since it's just a style reccomendation.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK