Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac89d38 commit e54681aCopy full SHA for e54681a
1 file changed
git-url/src/expand_path.rs
@@ -23,13 +23,12 @@ impl Url {
23
&self,
24
home_for_user: impl FnOnce(&UserExpansion) -> Option<PathBuf>,
25
) -> Result<PathBuf, Error> {
26
- fn join_relative(mut base: PathBuf, path: &Path) -> PathBuf {
27
- base.extend(path.components().skip(1));
28
- base
+ fn make_relative(path: &Path) -> PathBuf {
+ path.components().skip(1).collect()
29
}
30
let path = self.path.to_path()?;
31
Ok(match self.expansion.as_ref() {
32
- Some(user) => join_relative(home_for_user(user).ok_or(Error::MissingHome)?, path),
+ Some(user) => home_for_user(user).ok_or(Error::MissingHome)?.join(make_relative(path)),
33
None => self.path.to_path()?.into(),
34
})
35
0 commit comments