extern crate pct_str;
use pct_str::{InvalidPctString, PctStr};
fn main() -> Result<(), InvalidPctString<&'static str>> {
let buffer = "Hello%20World%21";
let pct_str = PctStr::new(buffer)?;
assert!(pct_str == "Hello World!");
assert!(pct_str.as_str() == "Hello%20World%21");
for c in pct_str.chars() {
print!("{}", c);
}
println!("");
let decoded_string: String = pct_str.decode();
println!("{}", decoded_string);
Ok(())
}