Writing in Rust gives me such xkcd.com/1425/ vibes.

🧠 Rewrite the application's entire cryptographic and network protocol, with no major bugs once it compiles...
⚙️ Sure, gimme a few hours.
🧠 ...and update the tests to concatenate some byte arrays inline.
⚙️ I'll need a research team and five years.

(Yeah, it's kind of like this in every programming language sometimes. Just finding Rust to be... more so.)

#RustLang

The answer turned out to be to write something like the below -- casting the first element to an unsized thing so that the compiler didn't get hung up on sizes not matching.

```
[b"..." as &[u8], b"more stuff"].concat()
```

Show thread
Follow

@varx Typecasting by any other name would be as safe. :-)

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml