Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Dec 20, 2024
1 parent d3dbb65 commit 2889583
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/deno_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ impl<'de> Deserialize<'de> for NodeModulesDirMode {
{
struct NodeModulesDirModeVisitor;

impl<'de> Visitor<'de> for NodeModulesDirModeVisitor {
impl Visitor<'_> for NodeModulesDirModeVisitor {
type Value = NodeModulesDirMode;

fn expecting(
Expand Down
6 changes: 2 additions & 4 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl DenoConfigFs for RealDenoConfigFs {
}
}

impl<'a> Default for &'a dyn DenoConfigFs {
impl Default for &dyn DenoConfigFs {
fn default() -> Self {
&RealDenoConfigFs
}
Expand All @@ -91,9 +91,7 @@ impl<'a> Default for &'a dyn DenoConfigFs {
pub struct DenoConfigPkgJsonAdapterFs<'a>(pub &'a dyn DenoConfigFs);

#[cfg(feature = "package_json")]
impl<'a> deno_package_json::fs::DenoPkgJsonFs
for DenoConfigPkgJsonAdapterFs<'a>
{
impl deno_package_json::fs::DenoPkgJsonFs for DenoConfigPkgJsonAdapterFs<'_> {
fn read_to_string_lossy(
&self,
path: &Path,
Expand Down
18 changes: 8 additions & 10 deletions src/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,16 +1134,14 @@ impl WorkspaceDirectory {
// so this is ok for now
let path = &paths[0];
match fs.stat_sync(path) {
Ok(info) => {
return Ok(
url_from_directory_path(if info.is_directory {
path
} else {
path.parent().unwrap()
})
.unwrap(),
)
}
Ok(info) => Ok(
url_from_directory_path(if info.is_directory {
path
} else {
path.parent().unwrap()
})
.unwrap(),
),
Err(_err) => {
// assume the parent is a directory
match path.parent() {
Expand Down
18 changes: 8 additions & 10 deletions src/workspace/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,14 @@ impl WorkspaceResolver {
.into(),
),
},
None => {
return Err(
WorkspaceResolveError::UnknownExport {
package_name: pkg.name.clone(),
export_name: export_name.to_string(),
exports: pkg.exports.keys().cloned().collect(),
}
.into(),
)
}
None => Err(
WorkspaceResolveError::UnknownExport {
package_name: pkg.name.clone(),
export_name: export_name.to_string(),
exports: pkg.exports.keys().cloned().collect(),
}
.into(),
),
}
}

Expand Down

0 comments on commit 2889583

Please sign in to comment.