aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-memory-cache
diff options
context:
space:
mode:
authorYuchen Wu <[email protected]>2024-03-29 15:42:20 -0700
committerAndrew Hauck <[email protected]>2024-04-05 11:46:20 -0700
commitdfcd3d1d9f493b830e97757ba8d43c07ee81c030 (patch)
tree0cfa357cd4257b0ea2b7c2d116c937426190b1cd /pingora-memory-cache
parent3c5d99c3f49a8d40a0fc16895b148dea9ea18e8d (diff)
downloadpingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.tar.gz
pingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.zip
Fix typos and grammar issues in docs
And other things. Co-authored-by: DimanNe <[email protected]> Co-authored-by: Xiaobo Liu <[email protected]> Co-authored-by: houseme <[email protected]> Co-authored-by: lilo <[email protected]> Co-authored-by: Yang He <[email protected]>
Diffstat (limited to 'pingora-memory-cache')
-rw-r--r--pingora-memory-cache/src/lib.rs4
-rw-r--r--pingora-memory-cache/src/read_through.rs10
2 files changed, 7 insertions, 7 deletions
diff --git a/pingora-memory-cache/src/lib.rs b/pingora-memory-cache/src/lib.rs
index 2b02d28..5e0254b 100644
--- a/pingora-memory-cache/src/lib.rs
+++ b/pingora-memory-cache/src/lib.rs
@@ -25,7 +25,7 @@ pub use read_through::{Lookup, MultiLookup, RTCache};
#[derive(Debug, PartialEq, Eq)]
/// [CacheStatus] indicates the response type for a query.
pub enum CacheStatus {
- /// The key was found in cache
+ /// The key was found in the cache
Hit,
/// The key was not found.
Miss,
@@ -109,7 +109,7 @@ impl<K: Hash, T: Clone + Send + Sync + 'static> MemoryCache<K, T> {
/// Insert a key and value pair with an optional TTL into the cache.
///
- /// An item with zero TTL of zero not inserted.
+ /// An item with zero TTL of zero will not be inserted.
pub fn put(&self, key: &K, value: T, ttl: Option<Duration>) {
if let Some(t) = ttl {
if t.is_zero() {
diff --git a/pingora-memory-cache/src/read_through.rs b/pingora-memory-cache/src/read_through.rs
index a10a7c0..aeeb9a3 100644
--- a/pingora-memory-cache/src/read_through.rs
+++ b/pingora-memory-cache/src/read_through.rs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//! An async read through cache where cache miss are populated via the provided
+//! An async read through cache where cache misses are populated via the provided
//! async callback.
use super::{CacheStatus, MemoryCache};
@@ -293,7 +293,7 @@ where
{
/// Same behavior as [RTCache::get] but for an arbitrary amount of keys.
///
- /// If there are keys that are missing from cache, `multi_lookup` is invoked to populate the
+ /// If there are keys that are missing from the cache, `multi_lookup` is invoked to populate the
/// cache before returning the final results. This is useful if your type supports batch
/// queries.
///
@@ -316,7 +316,7 @@ where
match CB::multi_lookup(&misses, extra).await {
Ok(miss_results) => {
// assert! here to prevent index panic when building results,
- // final_results has full list of misses but miss_results might not
+ // final_results has the full list of misses but miss_results might not
assert!(
miss_results.len() == misses.len(),
"multi_lookup() failed to return the matching number of results"
@@ -657,7 +657,7 @@ mod tests {
assert_eq!(resp[1].1, CacheStatus::Miss);
assert_eq!(resp[2].0, 3);
assert_eq!(resp[2].1, CacheStatus::Miss);
- // all hit after a fetch
+ // all hits after a fetch
let resp = cache
.multi_get([1, 2, 3].iter(), None, opt1.as_ref())
.await
@@ -673,7 +673,7 @@ mod tests {
#[tokio::test]
#[should_panic(expected = "multi_lookup() failed to return the matching number of results")]
async fn test_inconsistent_miss_results() {
- // force empty result
+ // force an empty result
let opt1 = Some(ExtraOpt {
error: false,
empty: true,