Skip to content

Commit 6c42de1

Browse files
committed
add documentation to raw regex type
1 parent cdfdafe commit 6c42de1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/raw/elem.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ pub struct RawRegex<'a> {
362362
}
363363

364364
impl<'a> RawRegex<'a> {
365-
pub fn new(data: &'a [u8]) -> RawResult<RawRegex<'a>> {
365+
pub(super) fn new(data: &'a [u8]) -> RawResult<RawRegex<'a>> {
366366
let pattern = read_nullterminated(data)?;
367367
let opts = read_nullterminated(&data[pattern.len() + 1..])?;
368368
if pattern.len() + opts.len() == data.len() - 2 {
@@ -377,10 +377,12 @@ impl<'a> RawRegex<'a> {
377377
}
378378
}
379379

380+
/// Gets the pattern portion of the regex.
380381
pub fn pattern(self) -> &'a str {
381382
self.pattern
382383
}
383384

385+
/// Gets the options portion of the regex.
384386
pub fn options(self) -> &'a str {
385387
self.options
386388
}

0 commit comments

Comments
 (0)