Crates.io | pwintln |
lib.rs | pwintln |
version | 0.1.3 |
source | src |
created_at | 2020-11-21 11:12:52.594016 |
updated_at | 2020-12-01 09:13:25.716688 |
description | println? OwO |
homepage | |
repository | https://github.com/lf-/pwintln |
max_upload_size | |
id | 314672 |
size | 21,700 |
you can upgrade your rust println functions across your entire codebase to all be pwintln, which will automatically uwu all your messages for you.
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"
we replace the libc's write function with our own wrapper which uwus
n/a