Closed davidbarsky closed 6 years ago
Oh yeah, I didn't realize that these changes would be breaking. Good idea to cut a breaking release.
It might make sense to explore error enums https://github.com/withoutboats/failure/blob/master/book/src/derive-fail.md#enums over strings in a 0.2.0 release? I could send a PR this weekend/next week exploring that possibility, if you'd like.
On Fri, Feb 2, 2018 at 12:12 AM, Jacob Peddicord notifications@github.com wrote:
Merged #12 https://github.com/amzn/askalono/pull/12.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amzn/askalono/pull/12#event-1454419932, or mute the thread https://github.com/notifications/unsubscribe-auth/AB-NPgzdxTkeds7B6PxER68HrSNSXNgyks5tQplLgaJpZM4R2o8r .
Enums/structs would be a good idea, yeah. Feel free to hack on it if you want, but no pressure. :)
Issue #, if available:
11. This PR shows
failure
in action, but I'd recommend reading the Failure book. It's a concise read and gives examples where different error-handling strategies would be appropriate.Description of changes: Sure! Couple things:
failure
, a draft replacement forstd::error::Error
. In the author's words:store::base::Store
. This reduces the quantity of types in the type signature, allows callers to avoid working with pointers directly, and avoids heap allocations on theOk(_)
path.failure::Error
instead ofstd::boxed::Box<Error>
, which—in my experience and opinion—is more ergonomic to use. However, I believe they have similar runtime semantics.Testing consisted of:
cargo build --release; cargo test
in both theaskalono
andaskalono-cli
crates.Legal Stuff By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. I don't believe that I need to sign a CLA, as we share the same employer.
Thanks for publishing this project! I learned some cool stuff about n-grams.