test/docstrings fixes (#207)

This commit is contained in:
Zrzka 2019-09-14 10:33:20 +02:00 committed by Timon
parent 2d4c1eec4d
commit 10af72ba2a
2 changed files with 10 additions and 11 deletions

View File

@ -43,12 +43,12 @@ impl TerminalInput {
/// Not sure what 'raw mode' is, checkout the 'crossterm_screen' crate.
///
/// # Example
/// ```rust
/// let input = input();
/// match input.read_line() {
/// ```ignore
/// let in = input();
/// match in.read_line() {
/// Ok(s) => println!("string typed: {}", s),
/// Err(e) => println!("error: {}", e),
/// }
/// }
/// ```
pub fn read_line(&self) -> io::Result<String> {
let mut rv = String::new();
@ -60,13 +60,12 @@ impl TerminalInput {
/// Read one character from the user input
///
/// ```rust
/// let input = input();
///
/// match input.read_char() {
/// ```ignore
/// let in = input();
/// match in.read_char() {
/// Ok(c) => println!("character pressed: {}", c),
/// Err(e) => println!("error: {}", e),
/// }
/// }
/// ```
pub fn read_char(&self) -> io::Result<char> {
self.input.read_char()

View File

@ -487,10 +487,10 @@ where
#[test]
fn test_parse_utf8() {
let st = "abcéŷ¤£€ù%323";
let ref mut bytes = st.bytes().map(|x| Ok(x));
let ref mut bytes = st.bytes();
let chars = st.chars();
for c in chars {
let b = bytes.next().unwrap().unwrap();
let b = bytes.next().unwrap();
assert_eq!(c, parse_utf8_char(b, bytes).unwrap());
}
}