strfmt 0.1.6

strfmt: rust library for formatting dynamic strings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12

use std::collections::HashMap;
use super::super::*;

#[test]
fn test_trait() {
    let mut vars: HashMap<String, String> = HashMap::new();
    vars.insert("x".to_string(), "X".to_string());

    assert_eq!("hi {x}".format(&vars).unwrap(), "hi X");
    assert_eq!("hi {x}".to_string().format(&vars).unwrap(), "hi X");
}