Closed
Description
- Go to stable API docs: http://doc.rust-lang.org/stable/std/
- In search bar, type "radix".
- See tons of
std::[type]::from_str_radix
methods. Pickstd::u32::from_str_radix
, click it and read the docs for it. - Try to use it like so (playpen link):
fn main() {
println!("{}" , std::u32::from_str_radix("1", 16).unwrap());
}
Output:
<anon>:3:19: 3:43 error: unresolved name `std::u32::from_str_radix`
<anon>:3 println!("{}" , std::u32::from_str_radix("1", 16).unwrap());
^~~~~~~~~~~~~~~~~~~~~~~~
Now bang your head for half an hour until you randomly call the method with u32::from_str_radix
, so without the std
prefix, in spite of the path provided in the API search box. :)
This code works:
fn main() {
println!("{}" , u32::from_str_radix("1", 16).unwrap());
}
Metadata
Metadata
Assignees
Labels
No labels