Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency for failure crate, and make NodeId::remove() infallible #39

Merged
merged 4 commits into from
Aug 4, 2019

Conversation

lo48576
Copy link
Contributor

@lo48576 lo48576 commented Aug 4, 2019

This is breaking change.

failure brings some dependencies, but errors in indextree is quite simple ("preconditions are not met"), and it is almost unnecessary.

  • NodeId::remove() is now infallible.
    • It does not fail in any situation, until indextree has inconsistency bug.
  • NodeId::insert_{before,after}, NodeId::{prepend,append} now returns Result<(), NodeError> instead of failure::Fallible<()>.
    • I believe no one needs powerful features of failure crate for these simple errors.
  • Examples in docs are a little improved.
    • Uses of insertions in the examples won't fail, so use .unwrap() explicitly, intead of using ? operator.

Node removal is infallible if the tree is consistent.
Insertion error (`NodeError`) is quite simple. `failure` is too
powerful and heavy for it.
Copy link
Owner

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, too

@saschagrunert saschagrunert merged commit 015c652 into saschagrunert:master Aug 4, 2019
@lo48576 lo48576 deleted the feature/drop-failure branch August 4, 2019 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants