[PATCH v2 2/5] rust: maple_tree: add MapleTree

Miguel Ojeda miguel.ojeda.sandonis at gmail.com
Sun Aug 24 05:00:16 PDT 2025


On Fri, Aug 22, 2025 at 11:49 PM Danilo Krummrich <dakr at kernel.org> wrote:
>
> As for
>
>         assert_eq!(foo().unwrap_err().kind(), ErrorKind::NotFound);
>
> vs.
>
>         assert!(foo().is_err_and(|e| x.kind() == ErrorKind::NotFound));
>
> the only thing I can think of is that the former fails differently for when
> foo() is Ok() vs. the error kind does not match. I assume that's what you mean?
>
> If so, I agree it's indeed a downside.

Yeah, the former checks independently the not-`Ok` part; plus we could
make `assert_eq!` print the actual values when it is the error code
part that fails like the real one.

Cheers,
Miguel



More information about the maple-tree mailing list