From 1d5087bc91da617ace7c5004a326511f8ce931aa Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Thu, 1 Feb 2024 14:35:22 -0800 Subject: [PATCH] fix(all): lints and fmt and clippy --- backend/src/main.rs | 5 +++-- backend/src/util.rs | 4 ++-- package.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index 0bd795c..5042d6e 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -245,11 +245,12 @@ fn recursive_serve(app: &mut tide::Server, path: Option<&Path>) { } fn serve_info(app: &mut tide::Server) { - app.at("/api/version_info") + app + .at("/api/version_info") .get(|_req: tide::Request| async move { let mut res = tide::Response::new(200); res.set_body(util::version_string()); res.set_content_type("text/plain"); Ok(res) }); -} \ No newline at end of file +} diff --git a/backend/src/util.rs b/backend/src/util.rs index 3016338..fa38eac 100644 --- a/backend/src/util.rs +++ b/backend/src/util.rs @@ -37,5 +37,5 @@ pub fn version_string() -> String { } fn no_quotes(s: &str) -> String { - s.replace("\"", "").replace("'", "") -} \ No newline at end of file + s.replace(['\"', '\''], "") +} diff --git a/package.json b/package.json index 6a29fb8..f5609c3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "start": "cd ./frontend && npm run build && cd ../backend && cargo run -- -u test -k test", "build:bun": "cd ./frontend && bun run build && cd ../backend && cargo build --release", "build": "cd ./frontend && npm run build && cd ../backend && cargo build --release", - "clippy:fix": "cargo clippy --manifest-path ./backend/Cargo.toml --all --fix", + "clippy:fix": "cargo clippy --manifest-path ./backend/Cargo.toml --all --allow-dirty --fix", "fmt:fix": "cargo fmt --manifest-path ./backend/Cargo.toml --all", "lint": "cd ./frontend && eslint ./src/**/*.tsx", "lint:fix": "cd ./frontend && eslint --fix ./src/**/*.tsx"