Skip to content

Commit

Permalink
Fixed clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arduano committed Mar 30, 2024
1 parent a0996e6 commit 382b84a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"search.exclude": {
".direnv/**": true
},
"cSpell.words": [
"rnix"
],
"cSpell.words": ["rnix"],
"editor.tabSize": 4,
"rust-analyzer.check.overrideCommand": [
"cargo",
"clippy",
"--all",
"--message-format=json",
"--all-targets"
]
}
6 changes: 3 additions & 3 deletions src/eval/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ fn import_nix_module<'s>(
mut ret: v8::ReturnValue,
) {
let module_path = args.get(0).to_rust_string_lossy(scope);
let module_source_str = std::fs::read_to_string(&module_path).unwrap();
let module_source_str = std::fs::read_to_string(module_path).unwrap();

let nix_fn = eval_nix_fn_from_string(scope, &module_source_str);

let nix_fn = match nix_fn {
Ok(nix_fn) => nix_fn,
Err(err) => {
let err_str = v8::String::new(scope, &err).unwrap();
let err_obj = v8::Exception::error(scope, err_str.into());
ret.set(err_obj.into());
let err_obj = v8::Exception::error(scope, err_str);
ret.set(err_obj);
return;
}
};
Expand Down

0 comments on commit 382b84a

Please sign in to comment.