A collection of tiny, reusable utility methods that reduce code size and improve performance.
- Fast string concatenation with minimal code size
- Bit counting utilities
no_stdcompatible with optionalstdfeature
Add to your Cargo.toml:
[dependencies]
nanokit = "0.2.1"use nanokit::string_concat::concat_2;
let result = concat_2("Hello, ", "world!");
assert_eq!(result, "Hello, world!");Save 2 instructions when you know the result length is less than isize::MAX:
use nanokit::string_concat_unsafe::concat_2_no_overflow;
let result = unsafe { concat_2_no_overflow("Hello, ", "world!") };use nanokit::count_bits::BitsNeeded;
assert_eq!(5u64.bits_needed_to_store(), 3); // 5 = 0b101For more details, see the nanokit crate documentation.
- nanokit: Core library with string concatenation and bit counting utilities
For step-by-step development guidance, see the Developer Manual.
We welcome contributions! See the Contributing Guide for details.
Licensed under MIT.