mirror of
https://github.com/bobwen-dev/hunter
synced 2025-04-12 00:55:41 +02:00
fix E0599
error[E0599]: no method named `remove_item` found for struct `Vec<files::File>` in the current scope
This commit is contained in:
parent
355d9a3101
commit
d663ff6a7b
@ -952,7 +952,9 @@ impl Files {
|
||||
let dirpath = self.directory.path.clone();
|
||||
self.find_file_with_path(&dirpath).cloned()
|
||||
.map(|placeholder| {
|
||||
self.files.remove_item(&placeholder);
|
||||
if let Some(pos) = self.files.iter().position(|x| *x == placeholder) {
|
||||
self.files.remove(pos);
|
||||
}
|
||||
if self.len > 0 {
|
||||
self.len -= 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user