Our great sponsors
-
sqlx
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite. (by launchbadge)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
num-format
A Rust crate for producing string representations of numbers, formatted according to international standards
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
codemap
A data structure for tracking source code positions, inspired by the type in rustc's libsyntax.
Then you should note that here where they're in the process of rewriting the crate (and have already removed the unsafe block you pointed out): https://github.com/RustCrypto/hashes/pull/228
I'm not sure how to use the sqlx migrate command. I'm not super experienced with migrations so I may be missing something, but with other tools I've used I thought I would run something like that and it would create a migration file for me with the SQL scripts. With this, I run that and it's an empty file, and the docs say: Creates a new file in migrations/-.sql. Add your database schema changes to this new file.
Code for Reference
I get the impression most of the time people are doing their Rust logging in the business thread, as opposed to using something like slog-async. For example, this repo only has 18 stars, whilst slog has 1.1k stars. Is it right to draw the conclusion that logging in a separate thread using an mpsc channel or something isn't typically a good idea?
It still seems super weird that you can use structs but not constants. Here's an example of a working workspace set up: https://github.com/jDomantas/reddit-help, see if there's anything different in yours.
Hi! I've been trying to add Rayon to a toy project I'm working on. First I changed my code to use iterators using chunks_mut (code here)… now I've changed to par_chunks_mut but I'm getting the following error:
I did not find a more mature package on this topic than https://github.com/bcmyers/num-format which currently only supports formatting of integers. So no floats and no parsing.
Actual generators (via the Generator trait) are not yet stable (tracking issue #43122), but they are usable on nightly, and you can e.g. use generator_extensions to get an Iterator from an (appropriate) Generator.
Using crates like generator (for Iterator) or async-stream (for Stream). Both have nice usage examples.
Right. Based on the comments here and some more pondering I'll try and replace the substrings (and backreferences to the original filename) with indices, using a crate like codemap. That crate doesn't seem to be maintained, so alternatives are welcome, but that's the idea.
The full code is here if more context is needed. The Token enum lives in token.rs, the pattern is called LanguageElement in the file of the same name and a good example of one of the functions is the massive construct_structure_from_tokens in parser.rs. The &'a str version lives in master and the Cowversion in the Cow-Attempt branch
I'll file a bug, thanks. https://github.com/rust-lang/book/issues/2631