From 96faa4efb6ba845099ffc802709553152d598e57 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 30 May 2021 18:32:20 -0500 Subject: [PATCH] refactor/ln ~ polish spelling (comments, names, and exceptions) --- src/uu/ln/src/ln.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index 04358a415..2a14f3c9c 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -371,21 +371,21 @@ fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) } fn relative_path<'a>(src: &Path, dst: &Path) -> Result> { - let abssrc = canonicalize(src, CanonicalizeMode::Normal)?; - let absdst = canonicalize(dst, CanonicalizeMode::Normal)?; - let suffix_pos = abssrc + let src_abs = canonicalize(src, CanonicalizeMode::Normal)?; + let dst_abs = canonicalize(dst, CanonicalizeMode::Normal)?; + let suffix_pos = src_abs .components() - .zip(absdst.components()) + .zip(dst_abs.components()) .take_while(|(s, d)| s == d) .count(); - let srciter = abssrc.components().skip(suffix_pos).map(|x| x.as_os_str()); + let src_iter = src_abs.components().skip(suffix_pos).map(|x| x.as_os_str()); - let result: PathBuf = absdst + let result: PathBuf = dst_abs .components() .skip(suffix_pos + 1) .map(|_| OsStr::new("..")) - .chain(srciter) + .chain(src_iter) .collect(); Ok(result.into()) }