From bc90e61c0a1b446f9c883ee3c901dc123bc050cf Mon Sep 17 00:00:00 2001 From: wenyanxiang Date: Sun, 8 Oct 2023 10:15:22 +0800 Subject: [PATCH] Update smol_str --- full-moon/Cargo.toml | 2 +- full-moon/src/short_string.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/full-moon/Cargo.toml b/full-moon/Cargo.toml index 54a29e63..56e3d9b4 100644 --- a/full-moon/Cargo.toml +++ b/full-moon/Cargo.toml @@ -31,7 +31,7 @@ full_moon_derive = { path = "../full-moon-derive", version = "=0.11.0" } logos = "0.12.1" paste = "1.0" serde = { version = "1.0", features = ["derive", "rc"], optional = true } -smol_str = { version = "0.1.23", features = ["serde"] } +smol_str = { version = "0.2.0", features = ["serde"] } stacker = { version = "0.1.15", optional = true } [dev-dependencies] diff --git a/full-moon/src/short_string.rs b/full-moon/src/short_string.rs index f75042de..2d5524b6 100644 --- a/full-moon/src/short_string.rs +++ b/full-moon/src/short_string.rs @@ -14,7 +14,7 @@ pub struct ShortString(SmolStr); impl ShortString { /// Creates a new ShortString from the given text. pub fn new + AsRef>(text: T) -> Self { - ShortString(SmolStr::from(text)) + ShortString(SmolStr::new(text)) } /// Returns a `&str` representation of the ShortString. @@ -49,6 +49,6 @@ impl Deref for ShortString { impl + AsRef> From for ShortString { fn from(value: T) -> Self { - ShortString(SmolStr::from(value)) + ShortString(SmolStr::new(value)) } }