Reporting a type error is fairly straightforward: making a good suggestion of how to fix it is much harder. I was really impressed with rustc's handling of Path printing here.
miniblog.
Related Posts
I'm writing a Path type in my programming language but not sure what methods belong on a Path.
Should I have some_path.read_string() or fs::read_string(some_path) instead?
I love .method() for IDE completion, but I don't want Path to be cluttered. I'm also trying to avoid UFCS.
Is there a good mnemonic for remembering borrowed : owned types in Rust?
&str : String
&[u8] : Vec<u8>
These are easy because I see them often. Knowing the owned equivalent of Path (it's PathBuf) is harder.
Flamegraphs are an indispensable tool, but sometimes I overuse them. Here's an example for difftastic -- it spends most of the time computing the shortest path.
I was able to make the diff graph smaller, making difftastic much faster -- but the new flamegraph looked the same!

