From fdac65930cb1b4c37b233c32cf63df504224d4f7 Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Sun, 22 Sep 2024 10:27:35 +0800 Subject: [PATCH] enable deny check --- .github/actions/check/action.yml | 8 ++++---- core/src/client.rs | 2 +- sql/src/value.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/check/action.yml b/.github/actions/check/action.yml index e6b931b01..70eea5b97 100644 --- a/.github/actions/check/action.yml +++ b/.github/actions/check/action.yml @@ -32,10 +32,10 @@ runs: run: | cargo machete - # - name: Deny Check - # shell: bash - # run: | - # cargo deny check + - name: Deny Check + shell: bash + run: | + cargo deny check - name: Clippy shell: bash diff --git a/core/src/client.rs b/core/src/client.rs index 9b56c389b..15d247c16 100644 --- a/core/src/client.rs +++ b/core/src/client.rs @@ -660,7 +660,7 @@ impl RouteHintGenerator { let uuid = uuid::Uuid::new_v4(); let current = format!("rh:{}:{:06}", uuid, nonce); let mut guard = self.current.lock().unwrap(); - *guard = current.clone(); + guard.clone_from(¤t); current } } diff --git a/sql/src/value.rs b/sql/src/value.rs index 3c7596a6a..0e6f0232b 100644 --- a/sql/src/value.rs +++ b/sql/src/value.rs @@ -943,7 +943,7 @@ pub fn parse_decimal(text: &str, size: DecimalSize) -> Result { } let text = &text[start..]; let point_pos = text.find('.'); - let e_pos = text.find(|c| c == 'e' || c == 'E'); + let e_pos = text.find(|c| ['E', 'e'].contains(&c)); let (i_part, f_part, e_part) = match (point_pos, e_pos) { (Some(p1), Some(p2)) => (&text[..p1], &text[(p1 + 1)..p2], Some(&text[(p2 + 1)..])), (Some(p), None) => (&text[..p], &text[(p + 1)..], None),