hgzimmerman / rocket-file-cache

An in-memory file cache for the Rocket web framework
MIT License
22 stars 6 forks source link

Make the Cache::get() method return a Result instead of an Option. #14

Closed hgzimmerman closed 6 years ago

hgzimmerman commented 6 years ago

Consider implementing a custom Result that contains 3 variants:

An ok() method could resolve this back to the existing Option, or this Err case could be rolled into the existing CachedFile implementation and would redirect to the 404 handler when responding, meaning that get() would return just a plain CachedFile.

hgzimmerman commented 6 years ago

implemented this by rolling an error case into CachedFile.