Closed DukeManh closed 1 year ago
@chshersh That's a great suggestion, I'm on it.
I have some questions.
Introduce a separate data type for TOML value types
Why do we need a separate type for toml and not use toml::value
?
we want to return all possible errors at once.
Is it something you have in mind? https://doc.rust-lang.org/rust-by-example/error/multiple_error_types.html
Why do we need a separate type for toml and not use toml::value?
toml::Value
also stores data inside. When we decode TOML, we don't expect any specific data, we expect only the shape of Data. So, unfortunately, we can't reuse toml::Value
here.
Is it something you have in mind? https://doc.rust-lang.org/rust-by-example/error/multiple_error_types.html
No, more like something similar:
@chshersh this is ready, can you review it, please?
@chshersh, I decided to reuse toml::Value
and type_str
to represent our expected type. What do you think?
Fixes #25
Provide more detailed TOML decoding errors by adding
DecodeError
enum to represent different error types.Author's questions:
I couldn't find better decoding than asstr() but I did map
Option<>
to `Result<, DecodeError>` so I guess dealing with Option is fine?Additional tasks