I wasn't on X, but now I've created a mastodon account :)
unsafe
does not disable the borrow checker. It does however give you abilities to circumvent it, namely by letting you dereference pointers, which are not subject to the borrow checker.
Actually, dead code eliminination should do the trick, if you're compiling a binary at least (same for a library I think, but there could be re-exports there). Did you compile in release mode?
No sarcasm, just an honest suggestion :)
From the Fine Readme:
This project allows you to create games for the Playdate handheld gaming system in Rust lang.
You really should preface every announcement with something like this :)
It's surprisingly simple: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f176852c61dcf0c3382f0ac97c26de03
As a side node, asking for a value, and then immediately calling to_string
on it seems kinda hiding the allocation. I'd suggest let the user call to_string
on it themselves.
(e) Changed it a bit to account for passing None
as the third argument.
I have an app that ultimately renders pdfs via typst. I'm starting to write tests for the output, exporting the documents to png instead and then applying something like https://github.com/kornelski/dssim or so.
(If anyone has experience with that, I'd take any hint I get ;))
Note that this is not only a cli and a (closed source) web editor, but also a library. So it's possible to embed a full typesetting library in your project, which is awesome. It's probably not on par with TeX yet, but you can already do an awful lot with it. Scripting it is really much, much easier than, say, LaTeX.
Wow, they're sort-of-targeting edition 2024. I did not expect this, holding my breath ;)
While funny, this also highlights part of why I like rust's error handling story so much: You can really just read the happy path and understand what's going on. The error handling takes up minimal space, yet with one glance you can see that errors are all handled (bubbled up in this case). The usual caveats still apply, of course ;)
Enums/Structs first, but those 2 are mixed, and any impl for them will be directly after the definition of the type itsef. Free functions last.
KillTheMule
0 post score0 comment score
And it really only concerns a certain subset - 32bit applications compiled with the gnu toolchain. I'm glad they keep the workload in check this way.