4 ms·
Well, writing to standard output requires interacting with an operating system, so it's not surprising that it requires `std`. You cannot write to standard outp
by GlitchMr 6y ago
Well, writing to standard output requires interacting with an operating system, so it's not surprising that it requires `std`. You cannot write to standard output without knowing what operating system you are compiling for.
Worth noting however that `writeln` only needs `core`, and as long you can provide an implementation of writing to standard output (pretty much create a struct and implement `core::fmt::Write` trait for it), creating `println` macro is trivial.
- steveklabnik 6y agoAn example of this: https://os.phil-opp.com/vga-text-mode/#a-println-macro https://os.phil-opp.com/vga-text-mode/#a-println-macro