printrn

Crates.ioprintrn
lib.rsprintrn
version0.1.5
sourcesrc
created_at2023-01-10 22:07:57.444624
updated_at2023-01-11 02:39:24.125328
descriptionA macro to replace `println!()`, that will replace all `\n` with `\r\n`, e.g. for crossterm or other raw terminal work.
homepage
repository
max_upload_size
id755876
size12,819
Alexandria (alxpettit)

documentation

README

printrn

A macro to replace println!(), that will replace all \n with \r\n.

This is useful when working with raw terminals, such as via crossterm or tui. In raw terminal mode, \n will only move the current line one down, and keep printing from there, like so:

APPLE
     BOOK
         CHERRY

Which is where \r (short for carriage Return) comes in. By replacing all \n with \r\n, you can get the more expected behavior:

APPLE
BOOK
CHERRY
Commit count: 0

cargo fmt