Skip to content

Commit 37aad7c

Browse files
committed
fix: clippy errors
1 parent 4cbcbb0 commit 37aad7c

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

crates/mun_hir/src/mock.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(test)]
2-
31
use mun_db::Upcast;
42
use mun_hir_input::SourceDatabase;
53
use mun_target::spec::Target;

crates/mun_hir/src/package_defs/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ fn tree_for_module(
240240
"mod {}",
241241
module
242242
.name(db)
243-
.map_or_else(|| "mod".to_owned(), |name| name.to_string())
243+
.map_or_else(|| "mod".to_owned(), |name| name.clone())
244244
));
245245

246246
// Add module level diagnostics
@@ -344,7 +344,7 @@ fn fully_qualified_module_path(db: &dyn HirDatabase, module: Module) -> String {
344344
.into_iter()
345345
.map(|m| {
346346
m.name(db)
347-
.map_or_else(|| "package".to_owned(), |name| name.to_string())
347+
.map_or_else(|| "package".to_owned(), |name| name.clone())
348348
})
349349
.rev(),
350350
"::".to_string(),

crates/mun_language_server/tests/integration_tests/document_symbols.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn format_document_symbol(symbol: &lsp_types::DocumentSymbol) -> text_trees::Str
8383
symbol
8484
.detail
8585
.as_ref()
86-
.map_or_else(String::new, |s| format!(" ({})", s))
86+
.map_or_else(String::new, |s| format!(" ({s})"))
8787
),
8888
symbol.children.iter().flatten().map(format_document_symbol),
8989
)

crates/mun_memory/tests/diff/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn apply_struct_mapping(
8383
match diff {
8484
FieldDiff::Insert { index, .. } => *index,
8585
FieldDiff::Move { new_index, .. } => *new_index,
86-
_ => std::usize::MAX,
86+
_ => usize::MAX,
8787
}
8888
}
8989

crates/mun_runtime_capi/src/test_util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ macro_rules! test_invalid_runtime {
7373
#[test]
7474
fn [<test_ $name _invalid_runtime>]() {
7575
let runtime = Runtime(ptr::null_mut());
76+
#[allow(clippy::macro_metavars_in_unsafe)]
7677
let handle =
7778
unsafe { [<mun_ $name>](runtime $(, $arg)*) };
7879

0 commit comments

Comments
 (0)