Fix off by one bug
parent
22ae25378e
commit
59d02e45c7
|
@ -51,7 +51,6 @@ impl Item for DirEntry {
|
||||||
}
|
}
|
||||||
fn retrieve(&self, parents: Vec<&DirEntry>) -> Vec<DirEntry> {
|
fn retrieve(&self, parents: Vec<&DirEntry>) -> Vec<DirEntry> {
|
||||||
let path: PathBuf = parents.into_iter().map(|e|&e.name).collect();
|
let path: PathBuf = parents.into_iter().map(|e|&e.name).collect();
|
||||||
println!("{}", path.to_string_lossy());
|
|
||||||
let mut v = Vec::new();
|
let mut v = Vec::new();
|
||||||
if let Ok(it) = read_dir(path) {
|
if let Ok(it) = read_dir(path) {
|
||||||
for i in it.filter_map(|v|v.ok()) {
|
for i in it.filter_map(|v|v.ok()) {
|
||||||
|
@ -120,8 +119,8 @@ impl<T: Item> RGeneralItemModel<T> {
|
||||||
children: None,
|
children: None,
|
||||||
data: d
|
data: d
|
||||||
};
|
};
|
||||||
row += 1;
|
|
||||||
children.push(self.entries.len() + row);
|
children.push(self.entries.len() + row);
|
||||||
|
row += 1;
|
||||||
new_entries.push(e);
|
new_entries.push(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue