mirror of https://github.com/spacejam/sled
prefix unused patterns with underscores in the hash join example
This commit is contained in:
parent
ab51cd4516
commit
b596f0e8c3
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue