quirks

Crates.ioquirks
lib.rsquirks
version0.4.0
created_at2025-12-12 06:15:26.480815+00
updated_at2026-01-09 01:09:12.435962+00
descriptionMiscellaneous helper functions for your library or application
homepage
repository
max_upload_size
id1981049
size11,540
Rory D. (pinecat)

documentation

README

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
Commit count: 0

cargo fmt