words_counter 0.1.0

This library is for calculating the frequencies of each word and also the total number of words in the story given by user
Documentation

use std::collections::HashMap;

pub fn words_count() {
    let mut short_story = String::new();
    println!("please give your short story\n    ");

    std::io::stdin().read_line(&mut short_story).expect("no stroy is given");

    let mut summary = HashMap::new();

    for word in short_story.split_whitespace() {
        let count = summary.entry(word).or_insert(0);
        *count += 1; 
    }    

    println!("\n    {:#?}", summary);

    println!("\n    The total Number of different words used in story : {}",summary.len() );

}
// #[cfg(test)]
// mod tests {
//     #[test]
//     fn it_works() {
//         assert_eq!(2 + 2, 4);
//     }
// }