From 7ca8a7816d7f4c488aff52697bae63e73066eeb5 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 2 Sep 2023 12:32:16 +0300 Subject: [PATCH] Enable clippy and update hooks. --- .pre-commit-config.yaml | 12 +++++------- src/lib.rs | 5 +---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f80ec6..eb9640d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,25 +16,23 @@ repos: rev: "v1.0" hooks: - id: fmt + - id: clippy + args: [--fix] - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: - id: isort - - repo: https://github.com/pycqa/flake8 - rev: "6.0.0" - hooks: - - id: flake8 - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.10.1 hooks: - id: pyupgrade - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.7.0 hooks: - name: black id: black args: ["--line-length", "79"] - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.0.0-alpha.4" + rev: "v3.0.3" hooks: - id: prettier diff --git a/src/lib.rs b/src/lib.rs index b87adea..8655530 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,10 +20,7 @@ impl RegexPy { } fn find(&self, value: &str) -> Option { - match self.inner.find(value) { - Some(inner) => Some(MatchPy { inner }), - None => None, - } + self.inner.find(value).map(|inner| MatchPy { inner }) } fn find_iter(&self, value: &str) -> Vec {