dakkar on Nostr: I'm learning Rust on company time apparently the way I learn Rust involves, among ...
I'm learning Rust on company time
apparently the way I learn Rust involves, among other things, spending an hour fiddling with the trait bounds to write:
```rust
use std::ops::Sub;
fn diff<X,Y>(x: X, y: Y) -> <X as Sub<Y>>::Output
where X: Sub<Y>
{
x - y
}
```
but hey, now I know
Published at
2026-02-03 14:40:51 UTCEvent JSON
{
"id": "cd878eeac69776abe501b2e0c4935c3060c88685b54f05943487e86920b98662",
"pubkey": "35cea42a9452605dd5a7cafb73c047aa2b4cc8a566853f215427ce284b647485",
"created_at": 1770129651,
"kind": 1,
"tags": [
[
"proxy",
"https://s.thenautilus.net/notes/aia9sxqq2h",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://s.thenautilus.net/notes/aia9sxqq2h",
"pink.momostr"
],
[
"-"
]
],
"content": "I'm learning Rust on company time\n\napparently the way I learn Rust involves, among other things, spending an hour fiddling with the trait bounds to write:\n\n```rust\nuse std::ops::Sub;\nfn diff\u003cX,Y\u003e(x: X, y: Y) -\u003e \u003cX as Sub\u003cY\u003e\u003e::Output\nwhere X: Sub\u003cY\u003e\n{\n x - y\n}\n```\n\nbut hey, now I know",
"sig": "115774476b14c3fcea2de09110389c287669e25332042e2c777086be45dc2a0ab95abb974f9b62998239228fa3904bd010a5d46c337cc552d962397d42444726"
}