Hacker News new | ask | show | jobs
by carlmr 161 days ago
On your example, without reading into the implementation, I'm wondering if the comment is wrong, or if the comment is telling us about a hidden default, but then what does the 2 mean.

    // Create an LRU cache with a capacity of 100 entries
    let mut cache = LRUKCache::new(2);

Why 100? Why not 2?
2 comments

Another time I wish rust had named parameters. For reading code without an IDE (which is a lot of the experience in discovering a library, learning, navigating in code on github...) it would be useful.
I think so, too, it's beautifully designed in many ways, but this seems like an oversight.
derp, It should be LRU instead of LRU-K.