mirror of https://github.com/bobwen-dev/hunter
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
26ab54fe74
|
@ -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…
Reference in New Issue