chore: use clippy to check rust code
This commit is contained in:
parent
1c1f3523a0
commit
7bcdddbf40
2 changed files with 3 additions and 2 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -13,6 +13,7 @@
|
|||
"yasm"
|
||||
],
|
||||
"dotnet.preferCSharpExtension": true,
|
||||
"rust-analyzer.check.command": "clippy",
|
||||
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue