squidge 0.2.3

squidge shortens delimited data
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented3 out of 3 items with examples
  • Size
  • Source code size: 12.45 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.73 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 25s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • dhth/squidge
    4 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dhth

squidge

✨ Overview

squidge shortens delimited data.

use squidge::{Config, shorten_line};

let line = "module/submodule/service/lib.rs";
let result = shorten_line(&Config::default(), &line);
let expected = vec!["m", "s", "s", "lib.rs"];
assert_eq!(result, expected);

squidge's functionality is available as a binary via sqdj.

🛠️ Configuration

squidge can be configured to shorten lines in varying ways, based on its Config.

use squidge::Config;
use regex::Regex;

let re = Regex::new("module").unwrap();
let cfg = Config {
    // Delimiter to split the line on
    delimiter: "\\",
    // Number of elements to ignore (for shortening) from the start
    ignore_first_n: 2,
    // Number of elements to ignore (for shortening) from the end
    ignore_last_n: 2,
    // Optional regex to determine which components to ignore while shortening
    ignore_regex: Some(re),
};