History

thanks clippy

With latest nightly

Sebastian Thiel committed 1 year ago

Commit 554ce131 parent 378b1be8 files · +17 −18Browse files

Unified · Split

8 files
  1. gix-attributes/tests/parse/mod.rs +9 −9
  2. gix-config/tests/config/parse/section.rs +1 −1
  3. gix-odb/src/store_impls/dynamic/load_index.rs +1 −0
  4. gix-ref/src/name.rs +1 −0
  5. gix-refspec/src/spec.rs +1 −0
  6. gix/tests/gix-init.rs +1 −1
  7. gix/tests/gix/object/tree/diff.rs +1 −1
  8. tests/it/src/commands/blame_copy_royal.rs +2 −6
gix-attributes/tests/parse/mod.rs+9−9
@@ -322,15 +322,15 @@ fn trailing_whitespace_in_attributes_is_ignored() { · 321 unmodified lines
322322
323323 type ExpandedAttribute<'a> = (parse::Kind, Vec<(BString, gix_attributes::StateRef<'a>)>, usize);
324324
325−fn set(attr: &str) -> (BString, StateRef) {
325+fn set(attr: &str) -> (BString, StateRef<'_>) {
326326 (attr.into(), StateRef::Set)
327327 }
328328
329−fn unset(attr: &str) -> (BString, StateRef) {
329+fn unset(attr: &str) -> (BString, StateRef<'_>) {
330330 (attr.into(), StateRef::Unset)
331331 }
332332
333−fn unspecified(attr: &str) -> (BString, StateRef) {
333+fn unspecified(attr: &str) -> (BString, StateRef<'_>) {
334334 (attr.into(), StateRef::Unspecified)
335335 }
336336
@@ -350,36 +350,36 @@ fn pattern(name: &str, flags: gix_glob::pattern::Mode, first_wildcard_pos: Optio · 13 unmodified lines
350350 })
351351 }
352352
353−fn try_line(input: &str) -> Result<ExpandedAttribute, parse::Error> {
353+fn try_line(input: &str) -> Result<ExpandedAttribute<'_>, parse::Error> {
354354 let mut lines = gix_attributes::parse(input.as_bytes());
355355 let res = expand(lines.next().unwrap())?;
356356 assert!(lines.next().is_none(), "expected only one line");
357357 Ok(res)
358358 }
359359
360−fn line(input: &str) -> ExpandedAttribute {
360+fn line(input: &str) -> ExpandedAttribute<'_> {
361361 try_line(input).unwrap()
362362 }
363363
364−fn byte_line(input: &[u8]) -> ExpandedAttribute {
364+fn byte_line(input: &[u8]) -> ExpandedAttribute<'_> {
365365 try_byte_line(input).unwrap()
366366 }
367367
368−fn try_byte_line(input: &[u8]) -> Result<ExpandedAttribute, parse::Error> {
368+fn try_byte_line(input: &[u8]) -> Result<ExpandedAttribute<'_>, parse::Error> {
369369 let mut lines = gix_attributes::parse(input);
370370 let res = expand(lines.next().unwrap())?;
371371 assert!(lines.next().is_none(), "expected only one line");
372372 Ok(res)
373373 }
374374
375−fn lenient_lines(input: &str) -> Vec<ExpandedAttribute> {
375+fn lenient_lines(input: &str) -> Vec<ExpandedAttribute<'_>> {
376376 gix_attributes::parse(input.as_bytes())
377377 .map(expand)
378378 .filter_map(Result::ok)
379379 .collect()
380380 }
381381
382−fn try_lines(input: &str) -> Result<Vec<ExpandedAttribute>, parse::Error> {
382+fn try_lines(input: &str) -> Result<Vec<ExpandedAttribute<'_>>, parse::Error> {
383383 gix_attributes::parse(input.as_bytes()).map(expand).collect()
384384 }
385385
gix-config/tests/config/parse/section.rs+1−1
@@ -11,7 +11,7 @@ mod header { · 10 unmodified lines
1111
1212 use bstr::BStr;
1313
14− fn cow_section(name: &str) -> Option<Cow<BStr>> {
14+ fn cow_section(name: &str) -> Option<Cow<'_, BStr>> {
1515 Some(Cow::Borrowed(name.into()))
1616 }
1717 mod write_to {
gix-odb/src/store_impls/dynamic/load_index.rs+1−0
@@ -734,6 +734,7 @@ impl PartialEq<Self> for Either { · 733 unmodified lines
734734 }
735735 }
736736
737+#[allow(clippy::non_canonical_partial_ord_impl)]
737738 impl PartialOrd<Self> for Either {
738739 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
739740 Some(self.path().cmp(other.path()))
gix-ref/src/name.rs+1−0
@@ -221,6 +221,7 @@ impl<'a> convert::TryFrom<&'a str> for PartialName { · 220 unmodified lines
221221 }
222222 }
223223
224+#[allow(clippy::infallible_try_from)]
224225 impl<'a> convert::TryFrom<&'a FullName> for &'a PartialNameRef {
225226 type Error = Infallible;
226227
gix-refspec/src/spec.rs+1−0
@@ -69,6 +69,7 @@ mod impls { · 68 unmodified lines
6969 }
7070 }
7171
72+ #[allow(clippy::non_canonical_partial_ord_impl)]
7273 impl PartialOrd for RefSpec {
7374 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
7475 Some(self.to_ref().cmp(&other.to_ref()))
gix/tests/gix-init.rs+1−1
@@ -268,7 +268,7 @@ mod with_overrides { · 267 unmodified lines
268268 Ok(())
269269 }
270270
271− fn cow_bstr(s: &str) -> Cow<BStr> {
271+ fn cow_bstr(s: &str) -> Cow<'_, BStr> {
272272 Cow::Borrowed(s.into())
273273 }
274274 }
gix/tests/gix/object/tree/diff.rs+1−1
@@ -879,7 +879,7 @@ mod track_rewrites { · 878 unmodified lines
879879 }
880880 }
881881
882−fn tree_named(repo: &gix::Repository, rev_spec: impl AsRef<str>) -> gix::Tree {
882+fn tree_named(repo: &gix::Repository, rev_spec: impl AsRef<str>) -> gix::Tree<'_> {
883883 repo.rev_parse_single(rev_spec.as_ref())
884884 .unwrap()
885885 .object()
tests/it/src/commands/blame_copy_royal.rs+2−6
@@ -161,14 +161,10 @@ git rm {src} · 160 unmodified lines
161161 "
162162 ),
163163 BlameScriptOperation::CommitFile(src, commit_id) => {
164− write!(
165− f,
166− r"# make file {src} contain content at commit {commit_id}
167−"
168− )?;
164+ writeln!(f, r"# make file {src} contain content at commit {commit_id}")?;
169165 if let Some(pos) = src.rfind_byte(b'/') {
170166 let dirname = src[..pos].as_bstr();
171− write!(f, "mkdir -p \"{dirname}\"\n")?;
167+ writeln!(f, "mkdir -p \"{dirname}\"")?;
172168 }
173169 write!(
174170 f,