From f755c3f740efc2b8bfa6cdf42779037617361cd4 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 8 Mar 2021 23:07:19 -0800 Subject: [PATCH] cleanup: access integer types' MAX constants directly on the type Using `std::u32::MAX` is deprecated. --- lib/src/index.rs | 2 +- lib/src/view.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/index.rs b/lib/src/index.rs index 9f7fdb5cb..8a1708e5c 100644 --- a/lib/src/index.rs +++ b/lib/src/index.rs @@ -906,7 +906,7 @@ impl<'a> CompositeIndex<'a> { // ancestors are not heads. // Also find the smallest generation number among the candidates. let mut work = BinaryHeap::new(); - let mut min_generation = std::u32::MAX; + let mut min_generation = u32::MAX; for pos in &candidate_positions { let entry = self.entry_by_pos(*pos); min_generation = min(min_generation, entry.generation_number()); diff --git a/lib/src/view.rs b/lib/src/view.rs index c2875460c..c18fa2dee 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -123,7 +123,7 @@ fn heads_of_set( ) -> HashSet { let mut visited = HashSet::new(); let mut work = vec![]; - let mut oldest = std::u64::MAX; + let mut oldest = u64::MAX; let mut heads: HashSet = commit_ids.collect(); for commit_id in &heads { let commit = store.get_commit(commit_id).unwrap();