[][src]Function rec::opt

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

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

Examples

use rec::{opt, Element};

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