Skip to content

Commit

Permalink
Add type annotations for new inference ambiguities
Browse files Browse the repository at this point in the history
Reviewed By: JakobDegen

Differential Revision: D51780425

fbshipit-source-id: 0ae1af16f3693fbd7e52d1ba56114dc0b3b37375
  • Loading branch information
David Tolnay authored and facebook-github-bot committed Dec 2, 2023
1 parent 6d6b525 commit b731396
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions eden/mononoke/blobstore/sqlblob/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ async fn generations(fb: FacebookInit) -> Result<(), Error> {
value_len
);
} else {
assert_eq!(generations, vec![], "No generations expected");
assert_eq!(
generations,
[] as [Option<u64>; 0],
"No generations expected",
);
}

let mark_gen = set_test_generations(test_source.as_ref(), 4, 3, 0, INITIAL_VERSION + 1);
Expand All @@ -357,7 +361,11 @@ async fn generations(fb: FacebookInit) -> Result<(), Error> {
assert_eq!(generations, vec![Some(3)], "Generation set to 3");
} else {
// We should now have no generations as the set_generation(key, true) should have inlined
assert_eq!(generations, vec![], "No generations expected");
assert_eq!(
generations,
[] as [Option<u64>; 0],
"No generations expected",
);
}

// don't need to run these with variety of key lengths
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/bonsai_git_mapping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ where
}
}

if hggit_source_extra == Some(b"git") {
if hggit_source_extra == Some("git".as_bytes()) {
if let Some(convert_revision_extra) = convert_revision_extra {
let git_sha1 = AsciiStr::from_ascii(convert_revision_extra)?;
let git_sha1 = GitSha1::from_ascii_str(git_sha1)?;
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/commit_rewriting/backsyncer/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ async fn compare_contents(
"source content: {:?}, target content {:?}",
source_content, target_content
);
let filtered_source_content = source_content
let filtered_source_content: HashMap<_, _> = source_content
.into_iter()
.filter_map(|(key, value)| {
mover(&NonRootMPath::new(key).unwrap())
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/derived_data/deleted_manifest/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub(crate) async fn test_find_entries<Root: RootDeletedManifestIdCommon>(
.unwrap();

entries.sort();
let expected_entries = vec![path("dir/f-2").into(), path("dir/sub/f-1").into()];
let expected_entries = [Some(path("dir/f-2")), Some(path("dir/sub/f-1"))];
assert_eq!(entries, expected_entries);
}

Expand Down

0 comments on commit b731396

Please sign in to comment.