pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
210 stars 23 forks source link

Change getting started example #71

Closed MattesWhite closed 4 years ago

MattesWhite commented 4 years ago

In fact, this PR changes nothing for users but removes some boilerplate code. Therefore, it is okay to close this PR. It is rather a minor recommendation for the future.

The change uses the trick from rustdoc's documentation: As of Rust 1.34 we can omit the fn main() -> Result<...> when an Ok::<...>(()) is returned.

Note: Box<dyn std::error::Error> is already semantically equal to CatchAll.

pchampin commented 4 years ago

I didn't know that trick, it is great. Thanks.

And yes, Box<dyn std::error::Error> is better than my ad-hoc CatchAll hack...