I\'m hoping to be able to use .into() to convert a value in a context where type inference is impossible. This is typically when I want to convert a temporary v
.into()
You could use From::from:
use std::convert::*; struct NewType(pub i32); impl From for i32 { fn from(src: NewType) -> i32 { src.0 } } fn main() { let a = NewType(5); println!("{}", i32::from(a)); }
You can read more about it in the docs for the convert module.