27
submitted 3 months ago by dessalines@lemmy.ml to c/rust@lemmy.ml

This would entail:

  • Pulling in the ClearUrls rules as a git submodule.
  • Reading / transforming the json there into Rust structs.
  • Creating a Rust crate that runs a .clean(input_url) -> String

Lemmy issue: https://github.com/LemmyNet/lemmy/issues/4905

you are viewing a single comment's thread
view the rest of the comments
[-] BB_C@programming.dev 4 points 3 months ago

Looks trivial and easy to automate.
I possibly would have done it if they had a test suite.
But unless I didn't look hard enough, they have no tests at all (other than linting)!

[-] dessalines@lemmy.ml 2 points 3 months ago* (last edited 3 months ago)

Yep, it'd be a pretty small library. I'm not sure if they generate those JSON rules from somewhere else, but either way they could be converted to defined rust objects as part of a build process.

This might be helpful: https://github.com/oxidecomputer/typify

this post was submitted on 19 Jul 2024
27 points (90.9% liked)

Rust Programming

8093 readers
1 users here now

founded 5 years ago
MODERATORS