Skip to content

Commit

Permalink
fix: support Rust 1.52 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jan 20, 2022
1 parent fb839f0 commit 9c14de3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion git-odb/src/store_impls/dynamic/load_index.rs
Expand Up @@ -257,7 +257,7 @@ impl super::Store {
.unwrap_or(0);
let mut num_indices_checked = 0;
let mut needs_generation_change = false;
let mut slot_indices_to_remove: Vec<_> = idx_by_index_path.into_values().collect();
let mut slot_indices_to_remove: Vec<_> = idx_by_index_path.into_iter().map(|(_, v)| v).collect();
while let Some((mut index_info, mtime, move_from_slot_idx)) = index_paths_to_add.pop_front() {
'increment_slot_index: loop {
if num_indices_checked == self.files.len() {
Expand Down
8 changes: 4 additions & 4 deletions git-odb/src/store_impls/dynamic/types.rs
Expand Up @@ -211,16 +211,16 @@ impl<T: Clone> OnDiskFile<T> {
match std::mem::replace(&mut self.state, OnDiskFileState::Missing) {
OnDiskFileState::Garbage(v) => self.state = OnDiskFileState::Loaded(v),
OnDiskFileState::Missing => self.state = OnDiskFileState::Unloaded,
other @ (OnDiskFileState::Loaded(_) | OnDiskFileState::Unloaded) => self.state = other,
other @ OnDiskFileState::Loaded(_) | other @ OnDiskFileState::Unloaded => self.state = other,
}
}

pub fn trash(&mut self) {
match std::mem::replace(&mut self.state, OnDiskFileState::Missing) {
OnDiskFileState::Loaded(v) => self.state = OnDiskFileState::Garbage(v),
other @ (OnDiskFileState::Garbage(_) | OnDiskFileState::Unloaded | OnDiskFileState::Missing) => {
self.state = other
}
other @ OnDiskFileState::Garbage(_)
| other @ OnDiskFileState::Unloaded
| other @ OnDiskFileState::Missing => self.state = other,
}
}
}
Expand Down

0 comments on commit 9c14de3

Please sign in to comment.