philbooth · GitHub

This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Conversation

There was a minor violation of the law of Demeter in our `AppError`
struct, where it was directly exposing its inner `AppErrorKind` to
callers. Not a huge deal, but it meant that any changes made to the
inner structure would leak out and require corresponding changes to the
consuming code (and I am planning some of those inner changes as part of
issue #210). Better to expose just the parts that are necessary via its
own API.
At the same time, I opted to replace the home-baked `AppError::json()`
method with a more conventional `impl Serialize`, because it's less
astonishing and just as easy to use with `serde_json::to_string`.

@philbooth

Closed

rfk

rfk approved these changes Nov 1, 2018

@philbooth

@philbooth

Read the original on github.com ↗