Skip to content

Commit a420c3f

Browse files
committed
Add convenience types for Substring
1 parent c4ab3a2 commit a420c3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ where
349349

350350
/// A convenience type that can be used in a constant or static.
351351
pub type SubstringConst = Substring<&'static [u8]>;
352+
/// A convenience type to save the need to specify that the inner object is a slice.
353+
pub type SubstringRef<'a> = Substring<&'a [u8]>;
354+
/// A convenience type to save the need to specify that the inner object is owned.
355+
pub type SubstringOwned = Substring<Vec<u8>>;
352356

353357
#[cfg(all(test, feature = "benchmarks"))]
354358
mod bench {

0 commit comments

Comments
 (0)