Salta al contenuto principale


Anyone looking for a fun small rust project? Create a crate for cleaning urls, based on the ClearUrls project


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: github.com/LemmyNet/lemmy/issu…

in reply to Dessalines

Did something similar last night. Might take a look into using ClearURLs instead: github.com/diogotcorreia/alt-u…
in reply to Dessalines

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)!
in reply to BB_C

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.
in reply to Dessalines

I just released a crate doing exactly that: crates.io/crates/clearurls

Let me know if if fits your need or you need anything else. Issues and PRs welcome.

in reply to jendrik

Whoa nice! I'll check it out and see how we can integrate it into lemmy.

Questo sito web utilizza cookie tecnici e di sessione. Proseguendo la navigazione su questo sito, accetti l'utilizzo dei cookie.