Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tdittr committed Nov 1, 2024
1 parent e7676d5 commit 9efb105
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions backend/src/bin/read-driver-db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@ fn read_all(dir: &Path) -> anyhow::Result<HashMap<String, Driver>> {
}

pub fn parse_crate(path: &Path) -> anyhow::Result<(String, Driver)> {
if !path
.extension()
.is_some_and(|ext| ext == OsStr::new("toml"))
{
bail!("Driver info has wrong exctension: {path:?}");
if path.extension().is_none_or(|ext| ext != OsStr::new("toml")) {
bail!("Driver info has wrong extension: {path:?}");
}

let Some(crate_name) = path.file_stem() else {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod spdx_expression_serde {
}

struct ExpressionVisitor;
impl<'de> serde::de::Visitor<'de> for ExpressionVisitor {
impl serde::de::Visitor<'_> for ExpressionVisitor {
type Value = Expression;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
12 changes: 3 additions & 9 deletions backend/src/driver_db/categories.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
use std::{
borrow::Cow,
collections::BTreeMap,
fmt::{Debug, Display},
str::FromStr,
};

use anyhow::bail;
use schemars::{json_schema, JsonSchema};
use std::fmt::Debug;

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(
Expand Down

0 comments on commit 9efb105

Please sign in to comment.