Currently, methods of static features can only be called through a feature, and the return value is displayed through type inference, therefore let x: Option<f32> = FromStr::from_str("3.14");. This will be more flexible if UFCS is implemented ( # 16293 ), at least eliminating the need to write a full type signature Option<f32>.
from_str , , . , , :
fn main() {
let result = from_str::<f32>("3.14");
println!("{}", result.unwrap());
}
playpen