Skip to content

Commit

Permalink
Fixing clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
notdanilo committed Sep 1, 2024
1 parent 1546710 commit e43e587
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ligen/ir/src/types/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Type {

/// Returns a new `Type` representing an array type.
pub fn array(type_: impl Into<Type>, length: usize) -> Self {
let path = Path::from(PathSegment::new(Identifier::array(), type_.into())).into();
let path = Path::from(PathSegment::new(Identifier::array(), type_.into()));
let length = Some(length);
Self { path, length }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ impl syn::parse::Parse for IntermediaryAttribute {
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
if input.peek(syn::Lit) {
input.parse().map(IntermediaryAttribute::Lit)
} else if let Ok(attribute) = input.parse().map(IntermediaryAttribute::Expr) {
Ok(attribute)
} else {
if let Ok(attribute) = input.parse().map(IntermediaryAttribute::Expr) {
Ok(attribute)
} else {
Ok(input.parse().map(IntermediaryAttribute::Meta).unwrap_or(IntermediaryAttribute::Unknown(input.to_string())))
}
Ok(input.parse().map(IntermediaryAttribute::Meta).unwrap_or(IntermediaryAttribute::Unknown(input.to_string())))
}
}
}
2 changes: 1 addition & 1 deletion tools/editor/src/gui/ui/layout/editor/ir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Pane for Editor {
ui.label("Filter");
ui.text_edit_singleline(&mut self.filter);
});
List::new("Symbols").show(ui, &mut self.symbols.symbols.iter_mut().filter(|symbol| symbol.to_string().contains(self.filter.as_str())), |ui, symbol| {
List::new("Symbols").show(ui, self.symbols.symbols.iter_mut().filter(|symbol| symbol.to_string().contains(self.filter.as_str())), |ui, symbol| {
ui.label(symbol.to_string());
});
UiResponse::None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ impl StringEditable for PathBuf {
}

fn update(&mut self, string: impl AsRef<str>) -> bool {
if let Ok(path_buf) = PathBuf::try_from(string.as_ref()) {
*self = path_buf;
true
} else {
false
}
*self = PathBuf::from(string.as_ref());
true
}
}

Expand Down Expand Up @@ -55,12 +51,8 @@ impl StringEditable for VersionRequirement {
}

fn update(&mut self, string: impl AsRef<str>) -> bool {
if let Ok(version) = VersionRequirement::try_from(string.as_ref()) {
*self = version;
true
} else {
false
}
*self = VersionRequirement::from(string.as_ref());
true
}
}

Expand Down

0 comments on commit e43e587

Please sign in to comment.