Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Showing type

  • Using the rust-analyzer will make your IDE show the type. Eg. in Visual Studio Code.
  • A trick that you can also use is to specify some type at the type of assignment, e.g. (), the unit.
  • Then the compiler will complain during compilation.
let x: () = ...
let readdir: () = std::path::Path::new(".").read_dir().unwrap();