[][src]Function rec::lazy_opt

pub fn lazy_opt<T: Element>(element: T) -> Rec

Returns a Rec representing the given Element lazily repeated 0 or 1 times.

Examples

use rec::{lazy_opt, Element};

assert_eq!(lazy_opt("x"), String::from("x??").into_rec());