encoding.rs: Fix example in doc comment

This commit is contained in:
John 2023-08-23 00:32:25 -05:00
parent 0a4313bd1b
commit 7286d93e63

View File

@ -20,14 +20,14 @@ use encoding_parser::EncodingParser;
/// ///
/// # Examples /// # Examples
/// ```rust /// ```rust
/// use msp430_asm::{*, parser::{Encoding, EncodingParser}}; /// use msp430_asm::{preamble::*, parser::preamble::*};
/// // Create a token sequence /// // Create a token sequence
/// let asm_file = r".b 8000(r15)"; /// let asm_file = r".b 8000(r15)";
/// // Create a single-operand encoding parser /// // Create a single-operand encoding parser
/// let single: EncodingParser = Encoding::single().end(); /// let single: EncodingParser = Encoding::single().end();
/// // Parse an Encoding from it /// // Parse an Encoding from it
/// let encoding: Encoding = single /// let encoding: Encoding = single
/// .parse(&Parser::default(), &mut Tokenizer::new(asm_file).ignore_spaces()) /// .parse(&Default::default(), &mut Tokenizer::new(asm_file).ignore_spaces())
/// .unwrap(); /// .unwrap();
/// // Print the Encoding /// // Print the Encoding
/// println!("{encoding}"); /// println!("{encoding}");