Posts tagged: rust

What it takes to parse MediaWiki page titles...in Rust

In the UseModWiki days, Wikipedia page titles were "CamelCase" and automatically linked (see CamelCase and Wikipedia). MediaWiki on the other hand uses the famous [[bracketed links]], aka "free links". For most uses, page titles are the primary identifier of a page, whether it's in URLs for external consumption or [[Page…

From<T> and Into<T>

From and Into are my new best friends: https://gitlab.com/mwbot-rs/mwbot/-/merge_requests/10/Why require users to specify their request parameters in one specific format when you could just accept every format? \o/

Toolforge Rust tutorial

I wrote a tutorial on how to deploy a #Rust web application on Wikimedia's #Toolforge platform: https://wikitech.wikimedia.org/wiki/Help:Toolforge/My_first_Rust_toolIt uses #Rocket and demonstrates how to make queries against #Wikipedia's MariaDB replicas.

Generating Rust types for MediaWiki API responses

I just released version 0.2.0 of the mwapi_responses crate. It automatically generates Rust types based on the query parameters specified for use in MediaWiki API requests. If you're not familiar with the MediaWiki API, I suggest you play around with the API sandbox. It is highly dynamic, with the user…

cargo-hack is the coolest

cargo-hack is the coolest #Rust testing tool I've learned about so far: . With a few parameters, you can test every feature combination as well as against a version range of Rust versions. My CI is now twice as slow, but I'm actually verifying each feature works, and the MSRV…

Cross-building Windows binaries in Rust

It was surprisingly simple to set up cross-building for #Windows binaries on my #Rust projects in CI: https://gitlab.com/legoktm/rust-ci-pipeline/-/commit/21c61d0412e6636c110fbd0461908c93ff5eda7cAnd the one place I was using Unix-specific code has been caught at compile time \o/Whenever I make new releases, Windows binaries will be uploaded by CI, but in the meantime here's my…

prometheus-airnow-exporter

New project: prometheus-airnow-exporter scrapes air quality info for your zip code from AirNow.gov's APIhttps://lib.rs/crates/prometheus-airnow-exporterThrew it together pretty quickly as a PoC to see if I could set up alerting when the air gets bad.#airnow #prometheus #californiaproblems

fridge-backup

Couldn't find a #btrfs snapshot backup tool that I liked so I just wrote my own: https://crates.io/crates/fridge-backupIt automatically takes daily snapshots and then you copy them to external drives, that's it. (Automatic cleanup is a TODO)Also, you should put your butter in the fridge so it doesn't go bad.

Wikimedia CI now supports Rust

Wikimedia CI now supports #rustlang projects! https://phabricator.wikimedia.org/T256827#6396091It's simple for now: it'll run rustfmt, clippy, tests and then generate/publish coverage reports and documentation post-merge. More features/checks can be added as people need and request :)