diff --git a/src/lib.rs b/src/lib.rs index 79de5dd..45efaee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,7 @@ //! ``` use std::fs::File; -use std::io::{self, Read, Write}; +use std::io::{Read, Result, Write}; use std::path::Path; pub mod node; @@ -76,7 +76,7 @@ pub use crate::parser::Parser; pub type Document = node::element::SVG; /// Open a document. -pub fn open(path: T, content: &'_ mut String) -> io::Result> +pub fn open(path: T, content: &'_ mut String) -> Result> where T: AsRef, { @@ -86,12 +86,12 @@ where } /// Read a document. -pub fn read(content: &'_ str) -> io::Result> { +pub fn read(content: &'_ str) -> Result> { Ok(Parser::new(content)) } /// Save a document. -pub fn save(path: T, document: &U) -> io::Result<()> +pub fn save(path: T, document: &U) -> Result<()> where T: AsRef, U: Node, @@ -101,7 +101,7 @@ where } /// Write a document. -pub fn write(mut target: T, document: &U) -> io::Result<()> +pub fn write(mut target: T, document: &U) -> Result<()> where T: Write, U: Node,