| Crates.io | generic-to |
| lib.rs | generic-to |
| version | 1.0.1 |
| created_at | 2025-10-27 16:09:35.128646+00 |
| updated_at | 2025-10-27 16:11:05.228255+00 |
| description | method-generic conversion traits |
| homepage | |
| repository | https://github.com/flippette/generic-to |
| max_upload_size | |
| id | 1903193 |
| size | 6,096 |
generic-tomethod-generic conversion traits.
use generic_to::*;
// instead of this
let one = <u16 as Into<u32>>::into(1);
// you can do this
let one = 1_u16.to::<u32>();
with the nightly feature enabled, all of these
traits can also be used in const contexts.
#![feature(const_trait_impl)]
# #[cfg(feature = "nightly")]
# mod nightly {
use generic_to::*;
// this is available now
const ONE: u32 = 1_u16.to();
# }