quirks 0.4.0

Miscellaneous helper functions for your library or application
Documentation
  • Coverage
  • 70%
    7 out of 10 items documented0 out of 0 items with examples
  • Size
  • Source code size: 11.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.79 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 27s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • pinecat

quirks

Miscellaneous helper functions for your library or application.

Installation

Simply run the following inside your Rust project:

cargo add quirks

Usage

Include the quirk(s) you want to use:

use std::fs;

use anyhow::Result;
use quirks::Edible;

fn main() -> Result<()> {
    let contents = fs::read_to_string("a_file_with_a_newline_at_the_end.txt")?.chomp();
    println!("{}", contents); // No double-newline
    Ok(())
}

Quirks

Below is a list of all the quirks and what they do. For more details, run cargo doc --open and browse the quirks crate.

  • Edible: Remove trailing newlines from &[str]s or [String]s via the chomp() function.
  • Lazy: Provides the nop!() macro, which does nothing (no operation).
  • Odyssey: Expand paths with a '~' (tilde) from &[str]s, [String]s, or [PathBuf]s via the expand() function.

Building

git clone https://library.cat/rory/quirks
cd quirks
cargo build