✏️ Pencil Box
A performance-focused, memory-efficient utility library for Rust — built for engineers who care about speed, safety, and maintainability.
✨🌟🌟🌟 If you find this project useful, please consider ⭐ starring it on GitHub! 🌟🌟🌟✨
📚 Documentation
🚀 Why Choose This Library?
While there are many libraries out there, this one is built different — with engineers in mind:
✅ Performance First
- Designed for speed and minimal latency
- Zero-cost abstractions where possible
🧠 Memory-Efficient by Design
- Built to minimize allocations and overhead
- Smart data structures and lean processing
🛡️ Safety Comes Standard
- No
unsafeblocks unless absolutely necessary — and always documented
⏱️ 48-Hour Response Promise
- 🐛 Bug reports: Responded to within 48 hours
- 💡 Feature requests: Reviewed and responded to in under 2 days
- 📦 Developer-first and actively maintained
⚡ Performance-focused. 💾 Memory-conscious. 🛡️ Safe by design. 🔁 Backed by a 48-hour support promise.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.1.11"
Replace
"0.1.11"with the latest version from crates.io.
Full feature list is available in the crate’s Cargo.toml.
🚀 Usage & Available Methods
Each function is currently part of the array module. Full documentation with examples is available via the official docs.rs documentation.
| Component | Function | Description | Full API docs / API Reference |
|---|---|---|---|
| array | chunk |
Split slices into fixed-size chunks | Full API Docs |
| array | compact |
Remove "empty" values using the IsEmpty trait |
Full API Docs |
| array | difference_performant |
Faster list difference using AHashSet |
Full API Docs |
| array | difference |
Compute list difference using HashSet |
Full API Docs |
| array | drop_end |
Remove N elements from the end of a vector | Full API Docs |
| array | drop_start |
Remove N elements from the beginning of a vector | Full API Docs |
| array | fill_default |
Fill a vector with T::default() values |
Full API Docs |
| array | fill_value |
Fill a vector with clones of a given value | Full API Docs |
| array | find_index |
Find the index of the first matching element | Full API Docs |
| array | find_indexes |
Find indices of all matching elements | Full API Docs |
| array | find_last_index |
Find the index of the last matching element | Full API Docs |
| array | flatten |
Flatten nested array-like structures into a single Vec<T> |
Full API Docs |
| array | intersection |
Compute elements common to all input collections | Full API Docs |
| array | uniq_performant |
Faster deduplication using AHashSet |
Full API Docs |
| array | uniq |
Remove duplicate elements using HashSet |
Full API Docs |
🧪 Running Tests
📊 Code Coverage
To generate a coverage report:
🔒 Safety
- ✅ 100% safe Rust (
#![forbid(unsafe_code)]) - ✅ No
unsafeblocks - ✅ Panic-free under all valid inputs
🤝 Contributing
I welcome contributions, bug reports, and feature requests!
- Open an issue
- Submit a PR
- Or just say hi — I typically respond in under 48 hours