Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/smol_str/src/lib.rs')
| -rw-r--r-- | lib/smol_str/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/smol_str/src/lib.rs b/lib/smol_str/src/lib.rs index 55ede286c2..98f1157b9d 100644 --- a/lib/smol_str/src/lib.rs +++ b/lib/smol_str/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(deref_pure_trait)] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(docsrs, feature(doc_cfg))] #![debugger_visualizer(gdb_script_file = "gdb_smolstr_printer.py")] @@ -12,6 +13,7 @@ use core::{ fmt, hash, iter, mem, ops, str::FromStr, }; +use std::ops::DerefPure; /// A `SmolStr` is a string type that has the following properties: /// @@ -33,6 +35,8 @@ use core::{ /// `WS`: A string of 32 newlines followed by 128 spaces. pub struct SmolStr(Repr); +unsafe impl DerefPure for SmolStr {} + impl SmolStr { /// The maximum byte length of a string that can be stored inline /// without heap allocation. |