Skip to content

Commit 9525ac8

Browse files
committed
thanks clippy
1 parent d9d9bc0 commit 9525ac8

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

gitoxide-core/src/repository/attributes/validate_baseline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub(crate) mod function {
100100
});
101101

102102
let stdout = std::io::BufReader::new(child.stdout.take().expect("we configured it"));
103-
let mut lines = stdout.lines().filter_map(Result::ok).peekable();
103+
let mut lines = stdout.lines().map_while(Result::ok).peekable();
104104
while let Some(baseline) = parse_attributes(&mut lines) {
105105
if tx_base.send(baseline).is_err() {
106106
child.kill().ok();

gix-actor/tests/identity/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use gix_actor::Identity;
33

44
#[test]
55
fn round_trip() -> gix_testtools::Result {
6-
static DEFAULTS: &'static [&'static [u8]] = &[
6+
static DEFAULTS: &[&[u8]] = &[
77
b"Sebastian Thiel <[email protected]>",
88
".. ☺️Sebastian 王知明 Thiel🙌 .. <[email protected]>".as_bytes(),
99
b".. whitespace \t is explicitly allowed - unicode aware trimming must be done elsewhere <[email protected]>"

gix-actor/tests/signature/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn trim() {
6464

6565
#[test]
6666
fn round_trip() -> Result<(), Box<dyn std::error::Error>> {
67-
static DEFAULTS: &'static [&'static [u8]] = &[
67+
static DEFAULTS: &[&[u8]] = &[
6868
b"Sebastian Thiel <[email protected]> 1 -0030",
6969
".. ☺️Sebastian 王知明 Thiel🙌 .. <[email protected]> 1528473343 +0230".as_bytes(),
7070
b".. whitespace \t is explicitly allowed - unicode aware trimming must be done elsewhere <[email protected]> 1528473343 +0230"

gix-features/tests/pipe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ mod io {
4949
writer.write_all(b"b\nc\n").expect("success");
5050
drop(writer);
5151
assert_eq!(
52-
reader.lines().flat_map(Result::ok).collect::<Vec<_>>(),
52+
reader.lines().map_while(Result::ok).collect::<Vec<_>>(),
5353
vec!["a", "b", "c"]
5454
)
5555
}

gix-pack/src/cache/delta/traverse/resolve.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,10 @@ fn decompress_all_at_once_with(b: &[u8], decompressed_len: usize, out: &mut Vec<
413413
INFLATE.with(|inflate| {
414414
let mut inflate = inflate.borrow_mut();
415415
inflate.reset();
416-
let res = inflate.once(b, out).map_err(|err| Error::ZlibInflate {
416+
inflate.once(b, out).map_err(|err| Error::ZlibInflate {
417417
source: err,
418418
message: "Failed to decompress entry",
419-
});
420-
res
419+
})
421420
})?;
422421
Ok(())
423422
}

gix-transport/tests/client/blocking_io/http/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn handshake_v1() -> crate::Result {
269269
let refs = refs
270270
.expect("v1 protocol provides refs")
271271
.lines()
272-
.flat_map(Result::ok)
272+
.map_while(Result::ok)
273273
.collect::<Vec<_>>();
274274
assert_eq!(
275275
refs,

gix/tests/repository/remote.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ mod find_remote {
192192
let repo = remote::repo("url-rewriting");
193193

194194
let baseline = std::fs::read(repo.git_dir().join("baseline.git"))?;
195-
let mut baseline = baseline.lines().filter_map(Result::ok);
195+
let mut baseline = baseline.lines().map_while(Result::ok);
196196
let expected_fetch_url: BString = baseline.next().expect("fetch").into();
197197
let expected_push_url: BString = baseline.next().expect("push").into();
198198

@@ -223,7 +223,7 @@ mod find_remote {
223223
let repo = remote::repo("bad-url-rewriting");
224224

225225
let baseline = std::fs::read(repo.git_dir().join("baseline.git"))?;
226-
let mut baseline = baseline.lines().filter_map(Result::ok);
226+
let mut baseline = baseline.lines().map_while(Result::ok);
227227
let expected_fetch_url: BString = baseline.next().expect("fetch").into();
228228
let expected_push_url: BString = baseline.next().expect("push").into();
229229
assert_eq!(

gix/tests/repository/worktree.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ mod with_core_worktree_config {
105105
std::fs::read(git_dir.join("status.baseline"))
106106
.unwrap()
107107
.lines()
108-
.filter_map(Result::ok)
108+
.map_while(Result::ok)
109109
.filter(|line| line.contains(" D "))
110110
.count()
111111
}

0 commit comments

Comments
 (0)