We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doublets<Item = T>
Doublets<T>
This is idiomatically more correct. For example – AsRef and Deref:
AsRef
Deref
let string = "hello".to_string(); // we want `AsRef<[u8]>` let bytes: &[u8] = string.as_ref(); // we want `AsRef<str>` let str: &str = string.as_ref();
let string = "hello".to_string(); let str = &*string; // we are given `str`
This will also make generic storing doublets than easier.
struct Wrapper<T, D: Doublets<T>> { doublets: D, _marker: PhantomData<T>, }
struct Wrapper<D: Doublets> { doublets: D, } // `T` is `D::Item`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Use
Doublets<Item = T>
instead ofDoublets<T>
This is idiomatically more correct. For example –
AsRef
andDeref
:This will also make generic storing doublets than easier.
The text was updated successfully, but these errors were encountered: