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 8342f22 commit c9ecbf1Copy full SHA for c9ecbf1
src/utils.rs
@@ -1,5 +1,5 @@
1
use std::borrow::Cow;
2
-use std::iter::repeat;
+use std::iter;
3
4
fn split_path(path: &str) -> Vec<&str> {
5
let mut last_idx = 0;
@@ -105,7 +105,7 @@ pub fn make_relative_path(base: &str, target: &str) -> String {
105
let prefix = find_common_prefix_of_sorted_vec(&items)
106
.map(|x| x.len())
107
.unwrap_or(0);
108
- let mut rel_list: Vec<_> = repeat("../").take(base_path.len() - prefix).collect();
+ let mut rel_list: Vec<_> = iter::repeat_n("../", base_path.len() - prefix).collect();
109
rel_list.extend_from_slice(&target_path[prefix..]);
110
if rel_list.is_empty() {
111
".".into()
0 commit comments