Skip to content

Instantly share code, notes, and snippets.

View kariy's full-sized avatar
🚙
my back hurts

Ammar Arif kariy

🚙
my back hurts
View GitHub Profile
@tdelabro
tdelabro / no_std-guide.md
Last active June 14, 2024 02:58
How to easely port a crate to `no_std`?

What is Rust's standard library?

One of the Rust programming language promises is "zero-cost abstraction". Therefore the language itself is pretty conservative about what it incorporates. Types that are basics in other languages, such as string, or features, such as async, cannot be part of the language itself because they are costly abstractions. The user may not need them at all, or he may prefer other alternative implementations. To make those types and functions available nonetheless, they are available as part of the Rust standard library, known as std. Part of this library, known as the prelude is imported by default in each .rs file so you don't have to repeat yourself too much.

Why would you want a no_std version of your crate?

Most of the time having this standard library available is not a problem because you run your code on a pretty standard environment: your own computer or a Linux server somewhere in the cloud. However, somet

@kariy
kariy / 🦀-resources.md
Last active August 7, 2023 05:50
Some cool resources I found to help me learn about the offical programming language of the furries and fembois (pick your side!)

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.