Profile for hikari

Header for hikari
Avatar for hikari
Display name
Kanbaru 🌟 (one hikari of too many)
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
19037
Followed by
1574
Following
203

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