Profile for hikari

Header for hikari
Avatar for hikari
Display name
hikari 🌟
Username
@hikari@noyu.me
Role
admin

About hikari

Bio

from another world; anime girls on the internet who are terrible at playing guitar and slightly less bad at programming; EN/SV/DE/日本語

Stats

Joined
Posts
17739
Followed by
1566
Following
197

Recent posts

rust question. a common pattern in code i’ve written is:

assert!(foo % bar == 0);
let count = foo / bar;

is there a standard way to do that as a single operation?

one of the things i really like about rust is how it helps you avoid errors by combining an assertion of some assumption (e.g. “foo is not None”) with obtaining a value based on that assumption (e.g. getting the value inside the Some()). so in this case, it’d be really nice if i could do something like foo.div_exact(bar).unwrap(). personally i’d put it in the stdlib…

Open thread at this post

oh no, I just had to reboot my server after it became unresponsive. it seems like it might have been serving a lot of fediverse requests, was it overwhelmed?

I hope that was legit traffic and not an attack. I should look up what domains are suspicious…

Open thread at this post

it's incredibly cute how ARMv6 code jumps back and forth between A32 (normal Arm code) and T32 (Thumb code) all the time. having the lowest bit of the function address mark whether it's Thumb is such a neat trick

Open thread at this post

Rust pro tip: if you have a C/C++ dependency for your project that you have to compile in your build script, consider making it into its own crate. Then it can be compiled in parallel to your Rust code, and it won't be recompiled unnecessarily if you need to change something else that has a build script. You can use Cargo “workspaces” to keep it in the same repo as your main crate.

Open thread at this post

thank you to whoever it was that added this helpful text to ld's vtable linker error message…

“NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.”

Open thread at this post