Using a Box<str> in Rust: https://mahdi.blog/rust-box-str-vs-string/
(Unlike String, it isn't resizable, so it doesn't need to store capacity. Box<str> is only two words, unlike the three words in String!)
I keep getting surprised by .lines() semantics in Rust.
"" -> empty
"foo" -> one line
"foo\n" -> one line
"foo\nbar" -> two lines
I end up using .split('\n') everywhere instead, but .lines() is so convenient it feels like a footgun.
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.