+17
-18
lines changedFilter options
+17
-18
lines changed Original file line number Diff line number Diff line change
@@ -322,15 +322,15 @@ fn trailing_whitespace_in_attributes_is_ignored() {
322
322
323
323
type ExpandedAttribute<'a> = (parse::Kind, Vec<(BString, gix_attributes::StateRef<'a>)>, usize);
324
324
325
-
fn set(attr: &str) -> (BString, StateRef) {
325
+
fn set(attr: &str) -> (BString, StateRef<'_>) {
326
326
(attr.into(), StateRef::Set)
327
327
}
328
328
329
-
fn unset(attr: &str) -> (BString, StateRef) {
329
+
fn unset(attr: &str) -> (BString, StateRef<'_>) {
330
330
(attr.into(), StateRef::Unset)
331
331
}
332
332
333
-
fn unspecified(attr: &str) -> (BString, StateRef) {
333
+
fn unspecified(attr: &str) -> (BString, StateRef<'_>) {
334
334
(attr.into(), StateRef::Unspecified)
335
335
}
336
336
@@ -350,36 +350,36 @@ fn pattern(name: &str, flags: gix_glob::pattern::Mode, first_wildcard_pos: Optio
350
350
})
351
351
}
352
352
353
-
fn try_line(input: &str) -> Result<ExpandedAttribute, parse::Error> {
353
+
fn try_line(input: &str) -> Result<ExpandedAttribute<'_>, parse::Error> {
354
354
let mut lines = gix_attributes::parse(input.as_bytes());
355
355
let res = expand(lines.next().unwrap())?;
356
356
assert!(lines.next().is_none(), "expected only one line");
357
357
Ok(res)
358
358
}
359
359
360
-
fn line(input: &str) -> ExpandedAttribute {
360
+
fn line(input: &str) -> ExpandedAttribute<'_> {
361
361
try_line(input).unwrap()
362
362
}
363
363
364
-
fn byte_line(input: &[u8]) -> ExpandedAttribute {
364
+
fn byte_line(input: &[u8]) -> ExpandedAttribute<'_> {
365
365
try_byte_line(input).unwrap()
366
366
}
367
367
368
-
fn try_byte_line(input: &[u8]) -> Result<ExpandedAttribute, parse::Error> {
368
+
fn try_byte_line(input: &[u8]) -> Result<ExpandedAttribute<'_>, parse::Error> {
369
369
let mut lines = gix_attributes::parse(input);
370
370
let res = expand(lines.next().unwrap())?;
371
371
assert!(lines.next().is_none(), "expected only one line");
372
372
Ok(res)
373
373
}
374
374
375
-
fn lenient_lines(input: &str) -> Vec<ExpandedAttribute> {
375
+
fn lenient_lines(input: &str) -> Vec<ExpandedAttribute<'_>> {
376
376
gix_attributes::parse(input.as_bytes())
377
377
.map(expand)
378
378
.filter_map(Result::ok)
379
379
.collect()
380
380
}
381
381
382
-
fn try_lines(input: &str) -> Result<Vec<ExpandedAttribute>, parse::Error> {
382
+
fn try_lines(input: &str) -> Result<Vec<ExpandedAttribute<'_>>, parse::Error> {
383
383
gix_attributes::parse(input.as_bytes()).map(expand).collect()
384
384
}
385
385
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ mod header {
11
11
12
12
use bstr::BStr;
13
13
14
-
fn cow_section(name: &str) -> Option<Cow<BStr>> {
14
+
fn cow_section(name: &str) -> Option<Cow<'_, BStr>> {
15
15
Some(Cow::Borrowed(name.into()))
16
16
}
17
17
mod write_to {
Original file line number Diff line number Diff line change
@@ -734,6 +734,7 @@ impl PartialEq<Self> for Either {
734
734
}
735
735
}
736
736
737
+
#[allow(clippy::non_canonical_partial_ord_impl)]
737
738
impl PartialOrd<Self> for Either {
738
739
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
739
740
Some(self.path().cmp(other.path()))
Original file line number Diff line number Diff line change
@@ -221,6 +221,7 @@ impl<'a> convert::TryFrom<&'a str> for PartialName {
221
221
}
222
222
}
223
223
224
+
#[allow(clippy::infallible_try_from)]
224
225
impl<'a> convert::TryFrom<&'a FullName> for &'a PartialNameRef {
225
226
type Error = Infallible;
226
227
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ mod impls {
69
69
}
70
70
}
71
71
72
+
#[allow(clippy::non_canonical_partial_ord_impl)]
72
73
impl PartialOrd for RefSpec {
73
74
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
74
75
Some(self.to_ref().cmp(&other.to_ref()))
Original file line number Diff line number Diff line change
@@ -268,7 +268,7 @@ mod with_overrides {
268
268
Ok(())
269
269
}
270
270
271
-
fn cow_bstr(s: &str) -> Cow<BStr> {
271
+
fn cow_bstr(s: &str) -> Cow<'_, BStr> {
272
272
Cow::Borrowed(s.into())
273
273
}
274
274
}
Original file line number Diff line number Diff line change
@@ -879,7 +879,7 @@ mod track_rewrites {
879
879
}
880
880
}
881
881
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<'_> {
883
883
repo.rev_parse_single(rev_spec.as_ref())
884
884
.unwrap()
885
885
.object()
Original file line number Diff line number Diff line change
@@ -161,14 +161,10 @@ git rm {src}
161
161
"
162
162
),
163
163
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}")?;
169
165
if let Some(pos) = src.rfind_byte(b'/') {
170
166
let dirname = src[..pos].as_bstr();
171
-
write!(f, "mkdir -p \"{dirname}\"\n")?;
167
+
writeln!(f, "mkdir -p \"{dirname}\"")?;
172
168
}
173
169
write!(
174
170
f,
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4