chore: use clippy to check rust code

This commit is contained in:
Kim, Jimin 2024-05-25 21:13:17 +09:00
parent 1c1f3523a0
commit 7bcdddbf40
Signed by: pomp
GPG key ID: D3932F82A0667A3B
2 changed files with 3 additions and 2 deletions

View file

@ -13,6 +13,7 @@
"yasm"
],
"dotnet.preferCSharpExtension": true,
"rust-analyzer.check.command": "clippy",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

View file

@ -17,7 +17,7 @@ fn main() {
// parse string
let nums: Vec<usize> = s
.split(" ")
.split(' ')
.map(|substr| substr.parse().expect("Failed to convert &str to usize"))
.collect();
@ -25,7 +25,7 @@ fn main() {
writer
.write_fmt(format_args!(
"{} = {}\n",
s.replace(" ", " + "),
s.replace(' ', " + "),
nums.iter().sum::<usize>()
))
.expect("Failed to write to stdout");