prefix unused patterns with underscores in the hash join example

This commit is contained in:
Tyler Neely 2020-02-26 20:17:29 +01:00
parent ab51cd4516
commit b596f0e8c3
1 changed files with 3 additions and 3 deletions

View File

@ -194,7 +194,7 @@ fn hash_join(db: &sled::Db) -> sled::Result<()> {
let (name, value_bytes) = name_value_res?;
let (_, home_name): (LayoutVerified<&[u8], CatValue>, &[u8]) =
LayoutVerified::new_from_prefix(&*value_bytes).unwrap();
let (ref mut cat_names, dog_names) =
let (ref mut cat_names, _dog_names) =
join.entry(home_name.to_vec()).or_insert((vec![], vec![]));
cat_names.push(std::str::from_utf8(&*name).unwrap().to_string());
}
@ -206,10 +206,10 @@ fn hash_join(db: &sled::Db) -> sled::Result<()> {
// note that this is reversed from the cat example above, where
// the variable bytes are at the other end of the value, and are
// extracted using new_from_prefix instead of new_from_suffix.
let (home_name, dog_value): (_, LayoutVerified<&[u8], DogValue>) =
let (home_name, _dog_value): (_, LayoutVerified<&[u8], DogValue>) =
LayoutVerified::new_from_suffix(&*value_bytes).unwrap();
if let Some((cat_names, ref mut dog_names)) = join.get_mut(home_name) {
if let Some((_cat_names, ref mut dog_names)) = join.get_mut(home_name) {
dog_names.push(std::str::from_utf8(&*name).unwrap().to_string());
}
}