Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created April 11, 2019 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/1be9795e3571f8f3b7414657f3715ab4 to your computer and use it in GitHub Desktop.
Save kunigami/1be9795e3571f8f3b7414657f3715ab4 to your computer and use it in GitHub Desktop.
// Every container key is smaller than the target_key. In this case we 'wrap around' the
// table and select the first element.
if (closest_key == std::u32::MAX) {
let result = self.containers.get_first();
match result {
None => {
return Err("Did not find first entry.");
}
Some((_, entry)) => {
let container_id = &entry.id;
return Ok(container_id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment