pat

Crates.iopat
lib.rspat
version1.0.1
sourcesrc
created_at2024-09-10 03:07:31.536118
updated_at2024-09-10 03:15:27.258988
descriptiontap values in place
homepage
repository
max_upload_size
id1370002
size3,224
Mack (theMackabu)

documentation

README

Pat

A Rust trait for performing operations on a value while returning the value itself, enabling fluent and chainable APIs.

Usage

use pat::Tap;

let result = 5
	 .tap(|x| *x += 1)
	 .tap(|x| *x *= 2);

assert_eq!(result, 12);

Features

  • Universal implementation for all types
  • Chainable operations
  • Preserves original type
Commit count: 0

cargo fmt