1 unstable release

0.1.0 Mar 10, 2024

#12 in #lists

Custom license

14KB

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

No runtime deps