Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 3, 2024
1 parent 0d76997 commit 5a9a940
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions compiler-core/src/language_server/tests/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub fn show_complete(code: &str, position: Position) -> String {
fn apply_conversion(src: &str, completions: Vec<CompletionItem>, value: &str) -> String {
let completion = completions
.iter()
.find(|c| c.label == value.to_string())
.expect(&format!("no completion with value `{value}`"));
.find(|c| c.label == *value)
.unwrap_or_else(|| panic!("no completion with value `{value}`"));

let mut edits = vec![];
if let Some(lsp_types::CompletionTextEdit::Edit(edit)) = &completion.text_edit {
Expand Down
12 changes: 6 additions & 6 deletions compiler-core/src/type_/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ macro_rules! assert_warnings_with_imports {
vec![
$(("thepackage", $name, $module_src)),*
],
crate::build::Target::Erlang,
$crate::build::Target::Erlang,
None
);

Expand All @@ -272,7 +272,7 @@ macro_rules! assert_warnings_with_imports {
#[macro_export]
macro_rules! assert_warning {
($src:expr) => {
let warning = $crate::type_::tests::get_printed_warnings($src, vec![], crate::build::Target::Erlang, None);
let warning = $crate::type_::tests::get_printed_warnings($src, vec![], $crate::build::Target::Erlang, None);
assert!(!warning.is_empty());
let output = format!("----- SOURCE CODE\n{}\n\n----- WARNING\n{}", $src, warning);
insta::assert_snapshot!(insta::internals::AutoName, output, $src);
Expand Down Expand Up @@ -309,7 +309,7 @@ macro_rules! assert_js_warning {
let warning = $crate::type_::tests::get_printed_warnings(
$src,
vec![],
crate::build::Target::JavaScript,
$crate::build::Target::JavaScript,
None,
);
assert!(!warning.is_empty());
Expand All @@ -324,7 +324,7 @@ macro_rules! assert_js_no_warnings {
let warning = $crate::type_::tests::get_printed_warnings(
$src,
vec![],
crate::build::Target::JavaScript,
$crate::build::Target::JavaScript,
None,
);
assert!(warning.is_empty());
Expand All @@ -337,7 +337,7 @@ macro_rules! assert_warnings_with_gleam_version {
let warning = $crate::type_::tests::get_printed_warnings(
$src,
vec![],
crate::build::Target::Erlang,
$crate::build::Target::Erlang,
Some($gleam_version),
);
assert!(!warning.is_empty());
Expand All @@ -349,7 +349,7 @@ macro_rules! assert_warnings_with_gleam_version {
#[macro_export]
macro_rules! assert_no_warnings {
($src:expr $(,)?) => {
let warnings = $crate::type_::tests::get_warnings($src, vec![], crate::build::Target::Erlang, None);
let warnings = $crate::type_::tests::get_warnings($src, vec![], $crate::build::Target::Erlang, None);
assert_eq!(warnings, vec![]);
};
($(($package:expr, $name:expr, $module_src:literal)),+, $src:expr $(,)?) => {
Expand Down

0 comments on commit 5a9a940

Please sign in to comment.