Allow the retrieval of the stored pattern as a &str
This commit is contained in:
parent
de5d217ddf
commit
42a6b4534f
|
@ -79,6 +79,10 @@ impl <'a> LuaPattern<'a> {
|
|||
LuaPattern::from_bytes_try(bytes).expect("bad pattern")
|
||||
}
|
||||
|
||||
pub fn as_str(self) -> &'a str {
|
||||
&String::from_utf8_lossy(self.patt)
|
||||
}
|
||||
|
||||
/// Match a slice of bytes with a pattern
|
||||
///
|
||||
/// ```
|
||||
|
|
Loading…
Reference in a new issue