[pbs-devel] [PATCH backup 5/6] chunk_store: do not explicitly write implied trait

Gabriel Goller g.goller at proxmox.com
Wed Jun 26 12:01:11 CEST 2024


On 26.06.2024 11:48, Maximiliano Sandoval wrote:
>Fixes the clippy warning:
>
>warning: this bound is already specified as the supertrait of `std::iter::FusedIterator`
>   --> pbs-datastore/src/chunk_store.rs:254:14
>    |
>254 |         impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>
>    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    |
>    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls
>    = note: `#[warn(clippy::implied_bounds_in_impls)]` on by default
>help: try removing this bound
>    |
>254 -         impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>
>255 -             + std::iter::FusedIterator,
>254 +         impl std::iter::FusedIterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>,
>
>Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
>---
> pbs-datastore/src/chunk_store.rs | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs
>index 9f6289c9..b97fcb68 100644
>--- a/pbs-datastore/src/chunk_store.rs
>+++ b/pbs-datastore/src/chunk_store.rs
>@@ -251,8 +251,7 @@ impl ChunkStore {
>     pub fn get_chunk_iterator(
>         &self,
>     ) -> Result<
>-        impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>
>-            + std::iter::FusedIterator,
>+        impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>,
>         Error,
>     > {
>         // unwrap: only `None` in unit tests

This one is wrong, the FusedIterator is removed here.
Correct is:

     impl std::iter::FusedIterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>,

The other changes look good to me!




More information about the pbs-devel mailing list