summaryrefslogtreecommitdiffstats
path: root/vendor/anes/examples/stdout.rs
blob: 9b5be7257eaa4cad89fe8a431869270cc66e87aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/// An example how to use the ANSI escape sequence.
use std::io::{Result, Write};

use anes;

fn main() -> Result<()> {
    let mut stdout = std::io::stdout();
    write!(stdout, "{}", anes::SaveCursorPosition)?;
    write!(stdout, "{}", anes::RestoreCursorPosition)?;
    stdout.flush()?;
    Ok(())
}