e2m 1.0.0

A lightweight CLI tool that transforms English words into emojis using only Rust’s standard library.
use std::{
    collections::HashMap,
    io::{self, Write},
};

fn main() {
    let mut emoji_map = HashMap::new();

    emoji_map.insert("heart", "❤️");
    emoji_map.insert("fire", "🔥");
    emoji_map.insert("smile", "😃");
    emoji_map.insert("cats", "🐈");
    emoji_map.insert("coffee", "☕️");
    emoji_map.insert("sun", "☀️");
    emoji_map.insert("moon", "🌝");

    print!("Enter a sentence: ");
    io::stdout().flush().unwrap();

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).expect("Read Error.");

    let result = buf
        .split_whitespace()
        .map(|word| emoji_map.get(word).map_or(word, |v| v))
        .collect::<Vec<_>>()
        .join(" ");

    println!("Transformed: {result}")
}