handle write error [CI SKIP]
This commit is contained in:
@@ -52,7 +52,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 mut file = File::open(&path)?;
|
let file = File::open(&path)?;
|
||||||
Box::new(file)
|
Box::new(file)
|
||||||
} else {
|
} else {
|
||||||
Box::new(stdout())
|
Box::new(stdout())
|
||||||
@@ -82,7 +82,7 @@ fn main() -> Result<(), Box<Error>> {
|
|||||||
// Let's get the actual text in this text node. A text node wraps around
|
// Let's get the actual text in this text node. A text node wraps around
|
||||||
// a RefCell<String>, so we need to call borrow() to get a &str out.
|
// a RefCell<String>, so we need to call borrow() to get a &str out.
|
||||||
//let text = text_node.as_text().unwrap().borrow();
|
//let text = text_node.as_text().unwrap().borrow();
|
||||||
write!(out, "{}", serialize_node(as_node)?);
|
write!(out, "{}", serialize_node(as_node)?)?;
|
||||||
/*if let Some(child) = as_node.first_child() {
|
/*if let Some(child) = as_node.first_child() {
|
||||||
|
|
||||||
//TODO: Convert Nodes to String, as this only works for Nodes containing plain text
|
//TODO: Convert Nodes to String, as this only works for Nodes containing plain text
|
||||||
|
Reference in New Issue
Block a user