There's more...

You might have noticed that we are not using the try-operator (?) while reading or writing in this recipe. This is because the function's expected error types, se::Error [77] and de::Error[93], are incompatible with std::io::Error. In Chapter 6Handling Errors; Providing user-defined Error types, we will explore how to avoid this by returning our own error type that encompasses the other ones mentioned.

The TOML crate used in this recipe is the same one that Cargo itself uses. If you are interested in how Cargo parses its own Cargo.toml file, you can check out https://github.com/rust-lang/cargo/blob/master/src/cargo/util/toml/mod.rs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.142.2