SeaQL / FireDBG.for.Rust

🔥 Time Travel Visual Debugger for Rust
https://firedbg.sea-ql.org
MIT License
1.21k stars 21 forks source link

Display `OsString` as `String` #15

Closed tyt2y3 closed 7 months ago

tyt2y3 commented 7 months ago

Discussed in https://github.com/SeaQL/FireDBG.for.Rust/discussions/8

Originally posted by **oneElectron** December 12, 2023 I know that it's early days for the project, and I don't know how difficult this may be to implement. # Use Case I have a project that works a lot with the file system. For my project it would be nice if FireDBG displayed PathBufs as strings, instead of as the underlying bytes. # Some Concerns I am aware that this would require some discussion on when FireDBG should decide to stringify a type. I am also aware that this might be somewhat difficult, given that PathBufs are stored as OsStrings, which means they might not be valid UTF-8 like normal Strings.
tyt2y3 commented 7 months ago

image

It prints:

&std::path::PathBuf { inner: std::ffi::os_str::OsString::from_encoded_bytes_unchecked(String::from("/home/hello").into_bytes()) }

horray (not yet released)

tyt2y3 commented 7 months ago

Released!