From: "Ayush Singh" <ayushdevel1325@gmail.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>,
michael.d.kinney@intel.com, jabeena.b.gaibusab@intel.com,
Jiewen Yao <jiewen.yao@intel.com>
Subject: Dealing with CRLF in Rust printing
Date: Tue, 28 Jun 2022 00:47:08 +0530 [thread overview]
Message-ID: <CA+Yfj7tccqAx=5+er8YC93CNv8OZygShNaagMJ9CparWzuOSfg@mail.gmail.com> (raw)
Hello everyone, I have been somewhat successful in implementing Rust
stdio for UEFI.
This means it is now possible to do things like this:
```rust
let s = 10;
println!("ConOut: {}", s);
eprintl!("StdErr: {}", s);
```
However, Rust uses LF on all platforms currently, which means that the
`println!`, `eprintln!` and other macros only output LF at the end.
After discussion in zulipchat [1], it seems that rather than changing
the macro, it would be better to change what is printed as output.
This means changing: `\n` to `\r\n`, when we go for printing to
screen.
Note: This means that the LF will be changed to CRLF only when using
stdio and not when writing to say an external file.
Firstly, I wanted to ask other people's opinions about doing this.
Secondly, I wanted to ask if `\r\r\n` is the same as `\r\n` or if the
extra CR should be trimmed.
Ayush Singh
[1]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.60println!.60.20for.20CRLF.20console
next reply other threads:[~2022-06-27 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 19:17 Ayush Singh [this message]
2022-06-28 3:03 ` Dealing with CRLF in Rust printing Michael D Kinney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+Yfj7tccqAx=5+er8YC93CNv8OZygShNaagMJ9CparWzuOSfg@mail.gmail.com' \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox