Jan :rust: :ferris: · @janriemer
599 followers · 4644 posts · Server floss.social

@jonas Besides the other answers:

If you are looking for a way to store multiple bool values in a memory efficient way, have a look at bitvec crate:

docs.rs/bitvec/latest/bitvec/

"[bitvec] specializes standard-library data structures (slices, arrays, and vectors of bool) to use _one-bit-per-bool storage_[...]"

"[it] brings the capabilities of C++’s compact bool storage and Erlang’s decomposable bit-streams to Rust" - from their docs

#Rust #rustlang #crate #CrateTip

Last updated 1 year ago

Jan :rust: :ferris: · @janriemer
564 followers · 3887 posts · Server floss.social

winnow - Making parsing a breeze:

github.com/winnow-rs/winnow

winnow is a parser combinator library written in Rust that started as a fork of .

Not sure yet, if I should migrate from nom 4.* to or . I really do like the good error recovery and parsing capabilities for PEGs of chumsky.πŸ₯°

#nom #winnow #chumsky #Rust #rustlang #parser #CrateTip

Last updated 1 year ago

Jan :rust: :ferris: · @janriemer
525 followers · 3152 posts · Server floss.social

It's here! πŸŽ‰

Announcing match-commutative | A macro that helps matching on patterns commutatively, reducing the use of duplicated patterns. ✨

This can be useful, if you need to match on `(operant1, op, operant2)`, where `op` builds a commutative relation between `operant1` and `operant2`.

Please see the docs for the actual use case and an example:

docs.rs/match-commutative

Tagging @rjacobson and @tuck, because they've been interested in this. πŸ˜‰

#Rust #rustlang #crates #CrateTip

Last updated 1 year ago

Jan :rust: :ferris: · @janriemer
513 followers · 2942 posts · Server floss.social

Oh, this looks fantastic! ✨

library to compare strings (or any sequences). 25+ algorithms, pure Rust, common interface, support.

github.com/life4/textdistance.

Based on popular and battle-tested textdistance library (and written by the same author).

Apparently, it also takes algorithms from the library, which I wished for to be written in Rust.

github.com/Yomguithereal/talis

#Rust #unicode #Python #talisman #JavaScript #textprocessing #NLP #textdiffing #diff #rustlang #crate #CrateTip

Last updated 1 year ago

Jan :rust: :ferris: · @janriemer
513 followers · 2878 posts · Server floss.social

Oh wow, this looks freakin' awesome! 🀩

welds - An async written in using the framework.

github.com/weldsorm/welds

You can even drop down to low-level sqlx queries, in case you need it:

github.com/weldsorm/welds/blob

#orm #Rust #sqlx #rustlang #CrateTip #crate

Last updated 1 year ago

Jan :rust: :ferris: · @janriemer
508 followers · 2715 posts · Server floss.social

As Jon said, HashSet and HashMap iteration ordering is random.

If you need to iterate in insert order, you can use a crate called indexmap by @bluss

lib.rs/crates/indexmap

It provides Set and Map data structures.

#Rust #rustlang #collections #CrateTip

Last updated 2 years ago

Jan :rust: :ferris: · @janriemer
422 followers · 1033 posts · Server floss.social

Ok, this looks really useful:

mirror-mirror | Powerful reflection library for (by EmbarkStudios)

github.com/EmbarkStudios/mirro

Especially, because Rust is known to lack capabilities of reflection.

And what a cool name! πŸ˜…

#CrateTip #crate #rustlang #reflection #Rust

Last updated 2 years ago