From 2105eab7f06feaddde2e707628710d4660b0221b Mon Sep 17 00:00:00 2001 From: mxsm Date: Thu, 7 Nov 2024 10:37:51 +0800 Subject: [PATCH] [ISSUE #13]Optimize impl From<&'static str> for CheetahString (#14) * [ISSUE #13]Optimize impl From<&'static str> for CheetahString * fix code style --- src/cheetah_string.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cheetah_string.rs b/src/cheetah_string.rs index 6d9596f..8dd34b2 100644 --- a/src/cheetah_string.rs +++ b/src/cheetah_string.rs @@ -27,9 +27,9 @@ impl From> for CheetahString { } } -impl From<&'static str> for CheetahString { - fn from(s: &'static str) -> Self { - CheetahString::from_static_str(s) +impl<'a> From<&'a str> for CheetahString { + fn from(s: &'a str) -> Self { + CheetahString::from_slice(s) } }