Open dsherret opened 6 months ago
As I understand it, a URL path is basically a Vec<String>
joined by and prefixed with "/"
, so this is the correct behavior
I assume something along the lines of if let Some(_) = segments.pop() {segments.push("");}
should give what you want
I ended up working around it, but it seems strange that this would be desired behaviour. For example instead of:
file:///some/path/to/file.js (file)
file:///some/path/to (file)
file:///some/path (file)
file:///some (file)
I would expect:
file:///some/path/to/file.js (file)
file:///some/path/to/ (dir)
file:///some/path/ (dir)
file:///some/ (dir)
Because when you're poping from a file url, you're going to the parent directory rather than a file in the grandparent directory with the same name as the parent directory.
Edit: Sorry, I accidentally hit some keyboard shortcut and closed the issue.
Describe the bug
Given the following code:
I get the following input and output:
I would have expected the following output instead with a trailing slash so that it remains a directory: