Skip to content

Commit 997bb7b

Browse files
committed
Get rid of an unnecessary mutability
1 parent 5d7d89f commit 997bb7b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/module.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl Input {
200200
};
201201

202202
// Split the target path into components
203-
let mut component_vec: Vec<_> = target_path
203+
let component_vec: Vec<_> = target_path
204204
.as_path()
205205
.components()
206206
.map(|c| c.as_os_str())
@@ -213,10 +213,7 @@ impl Input {
213213
// If there is such a root element in the path, construct the include path.
214214
// TODO: To be safe, check that the root path element still exists in a Git repository.
215215
if let Some(position) = root_position {
216-
let include_path = component_vec
217-
.split_off(position)
218-
.iter()
219-
.collect::<PathBuf>();
216+
let include_path = component_vec[position..].iter().collect::<PathBuf>();
220217
Some(include_path)
221218
// If no appropriate root element was found, use a generic placeholder.
222219
} else {

0 commit comments

Comments
 (0)