[][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, prelude::*};

assert_eq!(opt('x'), Rec::from("x?"));