diff --git a/README.md b/README.md index d206a77..8df47ee 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ The parser could also return the text without any formatting information, with t ```rust let rtf = r#"{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard Voici du texte en {\b gras}.\par}"#; let tokens = Lexer::scan(rtf); -let text = Parser::new(tokens).to_text(); +let document = Parser::new(tokens); +let text = document.to_text(); assert_eq!(text, "Voici du texte en gras."); ``` diff --git a/src/parser.rs b/src/parser.rs index 86b0717..a26b364 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -246,7 +246,6 @@ pub mod tests { use crate::header::{CharacterSet::*, FontFamily::*, RtfHeader}; use crate::include_test_file; use crate::lexer::Lexer; - use crate::Token::{CRLF, PlainText}; #[test] fn parser_simple_test() {