diff options
Diffstat (limited to 'vendor/anes/examples/stdout.rs')
-rw-r--r-- | vendor/anes/examples/stdout.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/anes/examples/stdout.rs b/vendor/anes/examples/stdout.rs new file mode 100644 index 000000000..9b5be7257 --- /dev/null +++ b/vendor/anes/examples/stdout.rs @@ -0,0 +1,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(()) +} |