rinse

Crates.iorinse
lib.rsrinse
version0.1.0
sourcesrc
created_at2024-03-10 23:47:09.977473
updated_at2024-03-10 23:47:09.977473
descriptiondeclutter url lists 🧽
homepage
repositoryhttps://github.com/redcloudvg/rinse
max_upload_size
id1169044
size38,292
(priv2024)

documentation

https://docs.rs/rinse

README

rinse

License Cargo Documentation

declutter url lists

use rinse::Rinse;

fn main() {
  let rinse = Rinse::default();

  // Remove duplicate URLs
  assert!(rinse.declutter_url("https://www.wikipedia.org"));
  assert!(!rinse.declutter_url("https://www.wikipedia.org"));

  // Remove duplicate URLs without reading query parameter values
  assert!(rinse.declutter_url("https://httpbin.org/get?hello=world"));
  assert!(!rinse.declutter_url("https://httpbin.org/get?hello=earth"));
  assert!(rinse.declutter_url("https://httpbin.org/get?hello=world&foo=bar"));

  // Allowed extensions
  assert!(rinse.declutter_url("https://www.rust-lang.org/"));
  assert!(rinse.declutter_url("https://www.rust-lang.org/static/scripts/init.js"));
  assert!(!rinse.declutter_url("https://www.rust-lang.org/static/images/site.webmanifest"));
  assert!(!rinse.declutter_url("https://www.rust-lang.org/static/styles/a11y-dark.css"));
}

Not yet implemented

Commit count: 0

cargo fmt