Open Timmmm opened 10 months ago
fn main() { let mut url = url::Url::parse("file:///d:/test").unwrap(); url.set_path("d:\\test\\main.foo"); dbg!(url); }
Output:
thread 'main' panicked at 'byte index 8 is out of bounds of `file://`', /playground/.cargo/registry/src/index.crates.io-6f17d22bba15001f/url-2.4.0/src/parser.rs:1207:34
Playground.
Slightly more minimised:
fn main() { let mut url = url::Url::parse("file://").unwrap(); dbg!(&url); url.set_path("x"); dbg!(&url); }
Output:
Playground.