Fix a lot of Clippy warnings (#1808)

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* bump msrv to 1.70.0 to silence warnings

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* fix a few more warnings

* fix a clippy warning

* remove a commented out line

* silense too many arguments error

* fix more clippy warnings

* prefix underscore to unused vars/functions to fix warnings

* use filter instead of map

* move raw-rs-tests feature flat to module level to fix unused imports warnings

* fix a couple of unused result warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Raminder Singh 2024-07-09 17:32:52 +05:30 committed by GitHub
parent f7ada701e5
commit 62f73df048
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 264 additions and 260 deletions

View file

@ -3,6 +3,9 @@ use syn::punctuated::Punctuated;
use syn::{Path, PathArguments, PathSegment, Token};
/// Returns `Ok(Vec<T>)` if all items are `Ok(T)`, else returns a combination of every error encountered (not just the first one)
// Allowing this lint because this is a false positive in this case. The fold can only be changed into a `try_fold` if the closure
// doesn't have an error case. See for details: https://rust-lang.github.io/rust-clippy/master/index.html#/manual_try_fold.
#[allow(clippy::manual_try_fold)]
pub fn fold_error_iter<T>(iter: impl Iterator<Item = syn::Result<T>>) -> syn::Result<Vec<T>> {
iter.fold(Ok(vec![]), |acc, x| match acc {
Ok(mut v) => x.map(|x| {