diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-28 09:59:15 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:13 +0300 |
commit | 18ab269a0e6967d78df8527679f2479c39650250 (patch) | |
tree | 300c052956f3d14422765e0b0c2ddc1e6a13dc8e /buffered-reader | |
parent | 93bf23b79a6ae7bf1a81964a338754d0c16d2ca0 (diff) |
Add an is_empty method when len is there
It is customary for Rust data container structures to have both
is_empty and len, methods, because is_empty can both more to the point
and also faster to implement.
Sometimes is_empty makes no sense, as it doesn't for
openpgp::types::Curve, which isn't a container structure. Arguably it
would be better to rename Curve::len to something like Curve::bits,
but as that would change the API, I've opted to tell clippy that not
having is_empty in this case is OK.
Found by clippy lint len_without_is_empty:
https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
Diffstat (limited to 'buffered-reader')
0 files changed, 0 insertions, 0 deletions