Cult I Mean Group
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Dessalines@lemmy.ml to Rust Programming@lemmy.ml · 10 months ago

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

message-square
message-square
6
fedilink
27
message-square

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

Dessalines@lemmy.ml to Rust Programming@lemmy.ml · 10 months ago
message-square
6
fedilink

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

alert-triangle
You must log in or register to comment.
  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    10 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.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      10 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

  • Diogo Correia@masto.pt
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    @dessalines Did something similar last night. Might take a look into using ClearURLs instead: https://github.com/diogotcorreia/alt-urls-discord-bot

    • Dessalines@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

      Nice! Ya that could be made very multi-purpose.

  • jendrik@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

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

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

    • Dessalines@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

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

Rust Programming@lemmy.ml

rust@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@lemmy.ml
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 11 users / day
  • 33 users / week
  • 42 users / month
  • 640 users / 6 months
  • 1 local subscriber
  • 8.73K subscribers
  • 235 Posts
  • 738 Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org