Skip to content

Commit 1038dab

Browse files
committed
thanks clippy
1 parent 8116664 commit 1038dab

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

git-mailmap/src/snapshot.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ impl Snapshot {
154154

155155
pub fn new<'a>(entries: impl IntoIterator<Item = crate::Entry<'a>>) -> Self {
156156
let mut snapshot = Self::default();
157-
snapshot.extend(entries);
157+
snapshot.merge(entries);
158158
snapshot
159159
}
160160

161-
pub fn extend<'a>(&mut self, entries: impl IntoIterator<Item = crate::Entry<'a>>) -> &mut Self {
161+
pub fn merge<'a>(&mut self, entries: impl IntoIterator<Item = crate::Entry<'a>>) -> &mut Self {
162162
for entry in entries {
163163
let old_email: EncodedStringRef<'_> = entry.old_email.into();
164164
assert!(
@@ -207,7 +207,7 @@ fn enriched_signature(
207207
new_email: Option<&BString>,
208208
new_name: Option<&BString>,
209209
) -> Option<Signature> {
210-
let time = time.clone();
210+
let time = *time;
211211
match (new_email, new_name) {
212212
(Some(new_email), Some(new_name)) => git_actor::Signature {
213213
email: new_email.to_owned(),
@@ -239,15 +239,15 @@ mod encoded_string {
239239
#[test]
240240
fn basic_ascii_case_folding() {
241241
assert_eq!(
242-
EncodedString::Utf8("FooBar".into()).cmp_ref(EncodedStringRef::Utf8("foobar".into())),
242+
EncodedString::Utf8("FooBar".into()).cmp_ref(EncodedStringRef::Utf8("foobar")),
243243
Ordering::Equal
244244
);
245245
}
246246

247247
#[test]
248248
fn no_advanced_unicode_folding() {
249249
assert_ne!(
250-
EncodedString::Utf8("Masse".into()).cmp_ref(EncodedStringRef::Utf8("Maße".into())),
250+
EncodedString::Utf8("Masse".into()).cmp_ref(EncodedStringRef::Utf8("Maße")),
251251
Ordering::Equal
252252
);
253253
}
@@ -259,7 +259,7 @@ mod encoded_string {
259259
Ordering::Equal
260260
);
261261
assert_ne!(
262-
EncodedString::Unknown("Foo".into()).cmp_ref(EncodedStringRef::Utf8("foo".into())),
262+
EncodedString::Unknown("Foo".into()).cmp_ref(EncodedStringRef::Utf8("foo")),
263263
Ordering::Equal
264264
);
265265
assert_ne!(

tests/tools/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ pub fn fixture_path(path: impl AsRef<Path>) -> PathBuf {
2727
PathBuf::from("tests").join("fixtures").join(path.as_ref())
2828
}
2929
pub fn fixture_bytes(path: impl AsRef<Path>) -> Vec<u8> {
30-
std::fs::read(fixture_path(path.as_ref())).expect(&format!("File at '{}' not found", path.as_ref().display()))
30+
match std::fs::read(fixture_path(path.as_ref())) {
31+
Ok(res) => res,
32+
Err(_) => panic!("File at '{}' not found", path.as_ref().display()),
33+
}
3134
}
3235
pub fn scripted_fixture_repo_read_only(
3336
script_name: impl AsRef<Path>,

0 commit comments

Comments
 (0)