use std::io::IoResult instead of std::fmt::Result
simplify by using try!
avoid some unnecessary locals
remove unused import
Merge pull request #3 from db48x/use-ioresults

use std::io::IoResult instead of std::fmt::Result