[][src]Function svalbard::smallest_value_in_hashmap

pub fn smallest_value_in_hashmap(hashmap: &HashMap<usize, u8>) -> Option<usize>

Finds the lowest ranked chapter and returns the an Option with the index of the chapter in the CHAPTERS array.

Examples

use svalbard::{State, smallest_value_in_hashmap};
use std::collections::HashMap;

let mut hashmap_example = HashMap::new();
hashmap_example.insert(1, 10);
hashmap_example.insert(90, 1);

let lowest_ranked_chapter = smallest_value_in_hashmap(&hashmap_example).unwrap();
assert_eq!(lowest_ranked_chapter, 90);

Returns the key corresponding to the SMALLEST value in a Hashmap.