diff --git a/src/main.rs b/src/main.rs index 48ef5ff..4716109 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,8 @@ -#[macro_use] -extern crate structopt; use structopt::StructOpt; mod opts; use html5ever::serialize::{serialize, SerializeOpts, TraversalScope}; -use kuchiki::NodeRef; use markup5ever::serialize::Serialize as MSerialize; use opts::Opts; use std::error::Error; @@ -13,8 +10,6 @@ use std::fs::File; use std::io; use std::io::Write; use std::io::{stdin, stdout, Read}; -use std::path::PathBuf; -extern crate kuchiki; use kuchiki::traits::*; @@ -52,7 +47,7 @@ fn main() -> Result<(), Box> { }; let mut out: Box = if let Some(path) = opt.output { - let file = File::open(&path)?; + let file = File::create(&path)?; Box::new(file) } else { Box::new(stdout())