this post was submitted on 20 Mar 2026
10 points (100.0% liked)
Rust Programming
9206 readers
8 users here now
founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Other useful
Debugimplementations:PathBufandPathwill give you the path with quotes and I believe, it escapes any non-UTF8 characters.std::time::Durationwill give you reasonably formatted output, likeDuration::from_millis(54321)will format as54.321s, whereasDuration::from_millis(321)will format as321ms. Not appropriate for every situation, but works pretty well for logging.