This commit is contained in:
parent
25dfa2f5f1
commit
3d2bea74d1
@ -1,11 +1,8 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate structopt;
|
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
mod opts;
|
mod opts;
|
||||||
|
|
||||||
use html5ever::serialize::{serialize, SerializeOpts, TraversalScope};
|
use html5ever::serialize::{serialize, SerializeOpts, TraversalScope};
|
||||||
use kuchiki::NodeRef;
|
|
||||||
use markup5ever::serialize::Serialize as MSerialize;
|
use markup5ever::serialize::Serialize as MSerialize;
|
||||||
use opts::Opts;
|
use opts::Opts;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
@ -13,8 +10,6 @@ use std::fs::File;
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::io::{stdin, stdout, Read};
|
use std::io::{stdin, stdout, Read};
|
||||||
use std::path::PathBuf;
|
|
||||||
extern crate kuchiki;
|
|
||||||
|
|
||||||
use kuchiki::traits::*;
|
use kuchiki::traits::*;
|
||||||
|
|
||||||
@ -52,7 +47,7 @@ fn main() -> Result<(), Box<Error>> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut out: Box<Write> = if let Some(path) = opt.output {
|
let mut out: Box<Write> = if let Some(path) = opt.output {
|
||||||
let file = File::open(&path)?;
|
let file = File::create(&path)?;
|
||||||
Box::new(file)
|
Box::new(file)
|
||||||
} else {
|
} else {
|
||||||
Box::new(stdout())
|
Box::new(stdout())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user