https://github.com/mintlu8/cached_fn
Cache a function's result in a map.
https://github.com/mintlu8/cached_fn
Last synced: 5 months ago
JSON representation
Cache a function's result in a map.
- Host: GitHub
- URL: https://github.com/mintlu8/cached_fn
- Owner: mintlu8
- License: apache-2.0
- Created: 2024-10-17T10:42:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-17T10:44:01.000Z (over 1 year ago)
- Last Synced: 2025-08-18T04:49:52.675Z (10 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Cached Fn
Cache a function's result in a map.
## Example
```rust
let mut cached_sqr = cached(|x| x * x);
assert_eq!(cached_sqr(3), 9);
```