Skip to content

Commit

Permalink
Make naming consistent to expect_revision
Browse files Browse the repository at this point in the history
  • Loading branch information
boba2fett committed Jan 2, 2024
1 parent 7c3def8 commit ec08134
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions async-nats/src/jetstream/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ impl Store {
/// # }
/// ```
pub async fn purge<T: AsRef<str>>(&self, key: T) -> Result<(), PurgeError> {
self.purge_expected_revision(key, None).await
self.purge_expect_revision(key, None).await
}

/// Purges all the revisions of a entry destructively if the resision matches, leaving behind a single
Expand All @@ -762,11 +762,11 @@ impl Store {
/// .await?;
/// kv.put("key", "value".into()).await?;
/// let revision = kv.put("key", "another".into()).await?;
/// kv.purge_expected_revision("key", Some(revision)).await?;
/// kv.purge_expect_revision("key", Some(revision)).await?;
/// # Ok(())
/// # }
/// ```
pub async fn purge_expected_revision<T: AsRef<str>>(
pub async fn purge_expect_revision<T: AsRef<str>>(
&self,
key: T,
revison: Option<u64>,
Expand Down
4 changes: 2 additions & 2 deletions async-nats/tests/kv_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ mod kv {

let wrong_revision = 3;
let failed = kv
.purge_expected_revision("dz", Some(wrong_revision))
.purge_expect_revision("dz", Some(wrong_revision))
.await
.is_err();
assert!(failed);

kv.purge_expected_revision("dz", Some(revision))
kv.purge_expect_revision("dz", Some(revision))
.await
.unwrap();
let history = kv.history("dz").await.unwrap().count().await;
Expand Down

0 comments on commit ec08134

Please sign in to comment.