pub fn fail<C: Cost>() -> Doc<C>Expand description
Creates a document that fails to render.
This is most useful when used with choices by making one path fail to render, forcing the printer to choose an alternative.
ยงExample
let doc = fail();
assert!(matches!(doc.validate(80), Err(pretty_expressive::Error)));
let doc = fail() | text("not a fail");
assert_eq!(doc.to_string(), "not a fail");