From 94dda2132635d858a5ef22e87beae82eb3d0c5a1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 27 Sep 2022 18:17:37 +0200 Subject: [PATCH] Fix clippy lints --- CONTRIBUTING.md | 10 ++++++++++ Makefile | 4 ++++ lychee-lib/src/client.rs | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 355b87b..1aceb88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,16 @@ Try one of these links to get started: If you would like to contribute a new feature, the best way to get started is to ask for some early feedback by creating an issue yourself and asking for feedback. +## Development Workflow + +1. Create a new development branch for your feature or bugfix. +2. Make your changes and commit them. +3. Run `cargo test` and `cargo clippy` to make sure your changes don't break anything. + We provide a few `make` targets to make this easier: + - `make lint` runs `cargo clippy` on all crates + - `make help` lists all available targets +4. Push your changes to your fork and create a pull request. + ## Thanks! No matter how small, we appreciate very contribution. You're awesome! diff --git a/Makefile b/Makefile index 30de19e..4eb7526 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ run: ## Run project locally docs: ## Generate and show documentation cargo doc --open +.PHONY: lint +lint: ## Run linter + cargo clippy --all-targets --all-features -- -D warnings + .PHONY: screencast screencast: ## Create a screencast for the docs svg-term --command 'assets/screencast.sh' --out 'assets/screencast.svg' --width 100 --padding 10 --window \ No newline at end of file diff --git a/lychee-lib/src/client.rs b/lychee-lib/src/client.rs index f0e7f7f..00afb9d 100644 --- a/lychee-lib/src/client.rs +++ b/lychee-lib/src/client.rs @@ -396,7 +396,7 @@ impl Client { let status = if self.filter.is_excluded(&uri) { Status::Excluded } else if uri.is_file() { - self.check_file(&uri).await + self.check_file(&uri) } else if uri.is_mail() { self.check_mail(&uri).await } else { @@ -539,7 +539,7 @@ impl Client { } /// Check a `file` URI. - pub async fn check_file(&self, uri: &Uri) -> Status { + pub fn check_file(&self, uri: &Uri) -> Status { if let Ok(path) = uri.url.to_file_path() { if path.exists() { return Status::Ok(StatusCode::OK);