Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix E0599 #123

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix E0599
error[E0599]: no method named remove_item found for struct Vec<files::File> in the current scope
  • Loading branch information
bobwen-dev committed Mar 1, 2021
commit 26ab54fe74d56ce5e58aba89562eeaaa25edc72a
4 changes: 3 additions & 1 deletion src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down