From a1c9c80124bed893ae2ffa51fce936f3504da762 Mon Sep 17 00:00:00 2001 From: Zhaolong Zhu Date: Wed, 12 Feb 2025 10:25:09 -0500 Subject: [PATCH] Fix a clippy warning This diff fixes the clippy warning about manual_strip: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 514d979..472408b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -409,8 +409,8 @@ pub unsafe fn py_module_initializer_impl( macro_rules! strip_raw { ($s:expr) => {{ let s = $s; - if s.starts_with("r#") { - &s[2..] + if let Some(end) = s.strip_prefix("r#") { + end } else { s }