Describe the bug
Given the following code:
fn pop_last_segment(mut url: Url) -> Url {
if let Ok(mut segments) = url.path_segments_mut() {
segments.pop();
}
url
}
I get the following input and output:
IN: file:///bar/deno.json
OUT: file:///bar
I would have expected the following output instead with a trailing slash so that it remains a directory: