Skip to content

Commit b67144f

Browse files
committed
cargo clippy --fix
1 parent 1906777 commit b67144f

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

errful/src/protocol.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ pub trait AsErrful: Error + Sized {
9494
F::from(self.errful())
9595
}
9696

97-
fn display_pretty(&self) -> PrettyDisplay
97+
fn display_pretty(&self) -> PrettyDisplay<'_>
9898
where
9999
Self: Sized,
100100
{
101101
self.display_errful()
102102
}
103103

104-
fn display_pretty_nocolor(&self) -> PrettyDisplay
104+
fn display_pretty_nocolor(&self) -> PrettyDisplay<'_>
105105
where
106106
Self: Sized,
107107
{
@@ -140,7 +140,7 @@ pub trait Errful: Error {
140140
None
141141
}
142142

143-
fn labels(&self) -> Option<Vec<Label>> {
143+
fn labels(&self) -> Option<Vec<Label<'_>>> {
144144
None
145145
}
146146

@@ -185,7 +185,7 @@ impl<'a> Label<'a> {
185185
self.span
186186
}
187187

188-
pub fn message(&self) -> &LabelMessage {
188+
pub fn message(&self) -> &LabelMessage<'_> {
189189
&self.message
190190
}
191191
}

gedcomfy/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub enum ValidationError {
3232
}
3333

3434
impl<S: GEDCOMSource + ?Sized> RawRecord<'_, S> {
35-
pub(crate) fn subrecord_optional(&self, subrecord_tag: &str) -> Option<&Sourced<RawRecord<S>>> {
35+
pub(crate) fn subrecord_optional(&self, subrecord_tag: &str) -> Option<&Sourced<RawRecord<'_, S>>> {
3636
self.records
3737
.iter()
3838
.find(|r| r.sourced_value.line.tag.sourced_value == subrecord_tag)

gedcomfy/src/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl<E: std::error::Error + 'static> std::error::Error for WithSourceCode<'_, E>
301301
}
302302

303303
impl<E: miette::Diagnostic + 'static> miette::Diagnostic for WithSourceCode<'_, E> {
304-
fn code<'a>(&'a self) -> Option<Box<(dyn std::fmt::Display + 'a)>> {
304+
fn code<'a>(&'a self) -> Option<Box<dyn std::fmt::Display + 'a>> {
305305
Some(Box::new("gedcomfy::error"))
306306
}
307307

gedcomfy/src/reader/encodings/ansel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl AnselErr {
2424
}
2525
}
2626

27-
pub(crate) fn decode(mut input: &[u8]) -> Result<Cow<str>, AnselErr> {
27+
pub(crate) fn decode(mut input: &[u8]) -> Result<Cow<'_, str>, AnselErr> {
2828
// if it’s pure ASCII we can return it straight away
2929
let ascii_err = match input.as_ascii_str() {
3030
Ok(str) => return Ok(str.as_str().into()),

gedcomfy/src/reader/lines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub enum LineSyntaxError {
9696
/// ## Syntax
9797
pub(crate) fn iterate_lines<S: GEDCOMSource + ?Sized>(
9898
source_code: &S,
99-
) -> impl Iterator<Item = Result<(Sourced<usize>, Sourced<RawLine<S>>), LineSyntaxError>> {
99+
) -> impl Iterator<Item = Result<(Sourced<usize>, Sourced<RawLine<'_, S>>), LineSyntaxError>> {
100100
// Line syntax is as follows:
101101
/*
102102
Line = Level D [Xref D] Tag [D LineVal] EOL

gedcomfy/src/reader/modes/ttl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl sophia_api::term::Term for Term<'_> {
6262
self
6363
}
6464

65-
fn bnode_id(&self) -> Option<sophia_api::term::BnodeId<sophia_api::MownStr>> {
65+
fn bnode_id(&self) -> Option<sophia_api::term::BnodeId<sophia_api::MownStr<'_>>> {
6666
match self {
6767
Term::UnnamedBNode(id) => {
6868
Some(sophia_api::term::BnodeId::new(format!("b{id}").into()).unwrap())
@@ -73,7 +73,7 @@ impl sophia_api::term::Term for Term<'_> {
7373
}
7474
}
7575

76-
fn iri(&self) -> Option<sophia_api::term::IriRef<sophia_api::MownStr>> {
76+
fn iri(&self) -> Option<sophia_api::term::IriRef<sophia_api::MownStr<'_>>> {
7777
match self {
7878
Term::NamedNode(iri) => {
7979
Some(sophia_api::term::IriRef::new(iri.deref().into()).unwrap())
@@ -82,18 +82,18 @@ impl sophia_api::term::Term for Term<'_> {
8282
}
8383
}
8484

85-
fn lexical_form(&self) -> Option<sophia_api::MownStr> {
85+
fn lexical_form(&self) -> Option<sophia_api::MownStr<'_>> {
8686
match self {
8787
Term::String(s) => Some(s.deref().into()),
8888
Term::NamedBNode(_) | Term::UnnamedBNode(_) | Term::NamedNode(_) => None,
8989
}
9090
}
9191

92-
fn language_tag(&self) -> Option<sophia_api::term::LanguageTag<sophia_api::MownStr>> {
92+
fn language_tag(&self) -> Option<sophia_api::term::LanguageTag<sophia_api::MownStr<'_>>> {
9393
None
9494
}
9595

96-
fn datatype(&self) -> Option<sophia_api::term::IriRef<sophia_api::MownStr>> {
96+
fn datatype(&self) -> Option<sophia_api::term::IriRef<sophia_api::MownStr<'_>>> {
9797
Some(IriRef::new_unchecked(
9898
"http://www.w3.org/2001/XMLSchema#string".into(), // DevSkim: ignore DS137138
9999
))

mdf/src/components.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ fn FormField(props: &FormFieldProps) -> impl Into<AnyElement<'static>> {
1414
};
1515

1616
element! {
17-
Box(
17+
View(
1818
border_style: if props.has_focus { BorderStyle::Round } else { BorderStyle::None },
1919
border_color: Color::Blue,
2020
padding_left: if props.has_focus { 0 } else { 1 },
2121
padding_right: if props.has_focus { 0 } else { 1 },
2222
) {
23-
Box(width: 15) {
23+
View(width: 15) {
2424
Text(content: format!("{}: ", props.label))
2525
}
26-
Box(
26+
View(
2727
background_color: Color::DarkGrey,
2828
width: 30,
2929
) {

snippets/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'a> Label<'a> {
7777
}
7878

7979
impl Highlighter<'_> {
80-
fn new(source_code: &str) -> Highlighter {
80+
fn new(source_code: &str) -> Highlighter<'_> {
8181
Highlighter {
8282
source_code,
8383
context_lines: 2,
@@ -346,7 +346,7 @@ struct LineHighlighter<'a> {
346346
}
347347

348348
impl LineHighlighter<'_> {
349-
fn new(source_code: &str) -> LineHighlighter {
349+
fn new(source_code: &str) -> LineHighlighter<'_> {
350350
LineHighlighter {
351351
source_code,
352352
line: Vec::new(),

0 commit comments

Comments
 (0)