bin+lib pwintln

println? OwO

1 unstable release

0.1.3 Dec 1, 2020

BSD-2-Clause

13KB
206 lines

pwintln

this is @the6p4c's fault

you can upgrade your rust println functions across your entire codebase to all be pwintln, which will automatically uwu all your messages for you.

uwusage

use std::io::Write;
use cstr::cstr;
use std::os::raw::c_void;

let s = cstr!("ferris is my friend\n");
println!("i love rust");
    // outputs: "i love rust"
pwintln::install().unwrap();
unsafe { libc::write(1, s.as_ptr() as *const c_void, s.to_bytes().len()) };
    // outputs: "ferris is my friend"
println!("i love rust");
    // outputs: "i wuv wust"
std::io::stdout().write_all(b"i love rust\n").unwrap();
    // outputs: "i love rust"

how

we replace the libc's write function with our own wrapper which uwus

motivation

n/a


lib.rs:

Warning: this library is programmed as a meme. You should not use it. Only Linux is supported, because it lets us have the worst ideas the fastest.

Dependencies

~7–14MB
~175K SLoC