clippy and eslint

pull/1964/head
amrbashir 9 months ago
parent bcada42dbd
commit 0b4de690fc
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

@ -210,10 +210,10 @@ permissions = [
let permission_path = permissions_dir.join(format!("{command}.toml"));
let content = std::fs::read_to_string(&permission_path)
.expect(&format!("failed to read {command}.toml"));
.unwrap_or_else(|_| panic!("failed to read {command}.toml"));
let mut permission_file = toml::from_str::<PermissionFile>(&content)
.expect(&format!("failed to deserialize {command}.toml"));
.unwrap_or_else(|_| panic!("failed to deserialize {command}.toml"));
for p in permission_file.permission.iter_mut() {
p.commands
@ -222,7 +222,7 @@ permissions = [
}
let out = toml::to_string_pretty(&permission_file)
.expect(&format!("failed to serialize {command}.toml"));
.unwrap_or_else(|_| panic!("failed to serialize {command}.toml"));
let out = format!(
r#"# Automatically generated - DO NOT EDIT!
@ -230,6 +230,7 @@ permissions = [
{out}"#
);
std::fs::write(permission_path, out).expect(&format!("failed to write {command}.toml"));
std::fs::write(permission_path, out)
.unwrap_or_else(|_| panic!("failed to write {command}.toml"));
}
}

@ -255,6 +255,7 @@ function fromBytes(buffer: FixedSizeArray<number, 8>): number {
const size = bytes.byteLength
let x = 0
for (let i = 0; i < size; i++) {
// eslint-disable-next-line security/detect-object-injection
const byte = bytes[i]
x *= 0x100
x += byte
@ -1045,7 +1046,7 @@ async function writeFile(
for await (const chunk of data) {
await file.write(chunk)
}
file.close()
await file.close()
} else {
await invoke('plugin:fs|write_file', data, {
headers: {

Loading…
Cancel
Save