Skip to content

Commit

Permalink
Merge pull request #1352 from google/clippy-5
Browse files Browse the repository at this point in the history
Clippy fix.
  • Loading branch information
adetaylor authored Jan 6, 2024
2 parents d223b2f + efa122b commit 2f84e49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions engine/src/ast_discoverer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ mod tests {
}
};
discoveries.search_item(&itm, None).unwrap();
assert!(discoveries.extern_rust_funs.get(0).unwrap().sig.ident == "bar");
assert!(discoveries.extern_rust_funs.first().unwrap().sig.ident == "bar");
}

#[test]
Expand All @@ -686,7 +686,7 @@ mod tests {
}
};
discoveries.search_item(&itm, None).unwrap();
assert!(discoveries.extern_rust_funs.get(0).unwrap().sig.ident == "bar");
assert!(discoveries.extern_rust_funs.first().unwrap().sig.ident == "bar");
}

#[test]
Expand All @@ -702,7 +702,7 @@ mod tests {
assert!(
discoveries
.extern_rust_types
.get(0)
.first()
.unwrap()
.get_final_ident()
== "Bar"
Expand Down
4 changes: 2 additions & 2 deletions engine/src/conversion/analysis/depth_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<'a, T: HasFieldsAndBases + Debug> Iterator for DepthFirstIter<'a, T> {
type Item = &'a T;

fn next(&mut self) -> Option<Self::Item> {
let first_candidate = self.queue.get(0).map(|api| api.name());
let first_candidate = self.queue.front().map(|api| api.name());
while let Some(candidate) = self.queue.pop_front() {
if !candidate
.field_and_base_deps()
Expand All @@ -54,7 +54,7 @@ impl<'a, T: HasFieldsAndBases + Debug> Iterator for DepthFirstIter<'a, T> {
return Some(candidate);
}
self.queue.push_back(candidate);
if self.queue.get(0).map(|api| api.name()) == first_candidate {
if self.queue.front().map(|api| api.name()) == first_candidate {
panic!(
"Failed to find a candidate; there must be a circular dependency. Queue is {}",
self.queue
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ pub fn do_run_test_manual(
let generated_rs_files = build_results.1;

if let Some(code_checker) = &rust_code_checker {
let mut file = File::open(generated_rs_files.get(0).ok_or(TestError::NoRs)?)
let mut file = File::open(generated_rs_files.first().ok_or(TestError::NoRs)?)
.map_err(TestError::RsFileOpen)?;
let mut content = String::new();
file.read_to_string(&mut content)
Expand Down

0 comments on commit 2f84e49

Please sign in to comment.