Skip to content

Commit

Permalink
chore: apply Clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Feb 5, 2025
1 parent 26508ff commit 3e88a3a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/server/src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn write_sync(message: Message) -> Result<()> {
let json = serde_json::to_string(&message)?;
let mut stdout = std::io::stdout().lock();
write!(stdout, "Content-Length: {}\r\n\r\n", json.len())?;
stdout.write_all(&json.as_bytes())?;
stdout.write_all(json.as_bytes())?;
stdout.flush()?;
event!(Level::DEBUG, "stdout: {json}");
Ok(())
Expand Down
7 changes: 4 additions & 3 deletions crates/service/src/binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn create_symbol_table(db: &dyn SymbolTablesCtx, uri: InternUri) -> Arc<SymbolTa
key: SymbolKey::new(node),
green: node.green().into(),
region,
kind: kind.clone(),
kind,
idx: Idx {
num: None,
name: Some(db.ident(ident.text().into())),
Expand Down Expand Up @@ -95,7 +95,7 @@ fn create_symbol_table(db: &dyn SymbolTablesCtx, uri: InternUri) -> Arc<SymbolTa
.and_then(|immediate| create_ref_symbol(db, immediate.syntax(), region, kind))
.unwrap_or_else(|| Symbol {
green: node.green().into(),
key: SymbolKey::new(&node),
key: SymbolKey::new(node),
region,
kind,
idx: Idx {
Expand Down Expand Up @@ -255,9 +255,10 @@ fn create_symbol_table(db: &dyn SymbolTablesCtx, uri: InternUri) -> Arc<SymbolTa
}
}
SyntaxKind::PLAIN_INSTR => {
let Some(instr) = PlainInstr::cast(node.clone()) else {
let Some(instr) = PlainInstr::cast(node) else {
continue;
};
let node = instr.syntax();
match instr.instr_name().as_ref().map(|token| token.text()) {
Some("call" | "ref.func" | "return_call") => {
let Some(region) = node
Expand Down
2 changes: 1 addition & 1 deletion crates/service/src/checker/dup_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn check(
// re-map this symbol kind to make comparison easier
SymbolKind::Param
} else {
symbol.kind.clone()
symbol.kind
};
map.entry((name, &symbol.region, kind))
.or_insert_with(|| Vec::with_capacity(1))
Expand Down

0 comments on commit 3e88a3a

Please sign in to comment.