I'm getting the impression from the compiler that if I want a struct with a path in it, I should really use a PathBuf - you can't use Path, it's !Sized - using &Path means you now need lifetimes everywhere - why does Path::new return &Path?
-
Show this thread
Replying to @mountain_ghosts
This generalizes to anything that uses the borrowed/owned (and usually growable) patterns. Vec over slice, String over str, PathBuf over Path, OsString over OsStr, etc. If your struct has references as fields, you should have a very good reason
2:03 PM - 30 May 2019
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.