diff --git a/src/encoding/complex/toml.md b/src/encoding/complex/toml.md index fd7aa3d..4f0de96 100644 --- a/src/encoding/complex/toml.md +++ b/src/encoding/complex/toml.md @@ -34,12 +34,11 @@ fn main() -> Result<(), Error> { Parse TOML into your own structs using [Serde]. ```rust -# #[macro_use] -# extern crate error_chain; #[macro_use] extern crate serde_derive; extern crate toml; +use toml::de::Error; use std::collections::HashMap; #[derive(Deserialize)] @@ -54,14 +53,8 @@ struct Package { version: String, authors: Vec, } -# -# error_chain! { -# foreign_links { -# Toml(toml::de::Error); -# } -# } -fn main() -> Result<()> { +fn main() -> Result<(), Error> { let toml_content = r#" [package] name = "your_package" diff --git a/src/encoding/csv/read.md b/src/encoding/csv/read.md index ecff7d1..3820e79 100644 --- a/src/encoding/csv/read.md +++ b/src/encoding/csv/read.md @@ -36,17 +36,9 @@ Serde deserializes data into strongly type structures. See the ```rust extern crate csv; -# #[macro_use] -# extern crate error_chain; #[macro_use] extern crate serde_derive; -# error_chain! { -# foreign_links { -# Reader(csv::Error); -# } -# } -# #[derive(Deserialize)] struct Record { year: u16, @@ -55,7 +47,7 @@ struct Record { description: String, } -fn main() -> Result<()> { +fn main() -> Result<(), csv::Error> { let csv = "year,make,model,description 1948,Porsche,356,Luxury sports car 1967,Ford,Mustang fastback 1967,American car";