Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add must_use to update_user functions #543

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autopush-common/src/db/bigtable/bigtable_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ impl DbClient for BigTableClientImpl {
/// BigTable doesn't really have the concept of an "update". You simply write the data and
/// the individual cells create a new version. Depending on the garbage collection rules for
/// the family, these can either persist or be automatically deleted.
#[must_use]
async fn update_user(&self, user: &User) -> DbResult<bool> {
self.add_user(user).await?;
// TODO: is a conditional check possible?
Expand Down
1 change: 1 addition & 0 deletions autopush-common/src/db/dual/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl DbClient for DualClientImpl {
target.add_user(user).await
}

#[must_use]
async fn update_user(&self, user: &User) -> DbResult<bool> {
// If the UAID is in the allowance, move them to the new data store
let (target, is_primary) = self.allot(&user.uaid).await?;
Expand Down
1 change: 1 addition & 0 deletions autopush-common/src/db/dynamodb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl DbClient for DdbClientImpl {
Ok(())
}

#[must_use]
async fn update_user(&self, user: &User) -> DbResult<bool> {
let mut user_map = serde_dynamodb::to_hashmap(&user)?;
user_map.remove("uaid");
Expand Down
1 change: 1 addition & 0 deletions autopush-common/src/db/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl DbClient for Arc<MockDbClient> {
Arc::as_ref(self).add_user(user).await
}

#[must_use]
async fn update_user(&self, user: &User) -> DbResult<bool> {
Arc::as_ref(self).update_user(user).await
}
Expand Down