Skip to content

Commit

Permalink
Merge branch 'main' into remove-special-handling-virtual-accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbzurovski authored Dec 10, 2024
2 parents a326b40 + 723d183 commit fe1132e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 43 deletions.
19 changes: 0 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,3 @@ repos:
types: [file, rust]
entry: cargo test --lib
pass_filenames: false

- repo: https://github.com/phylum-dev/phylum-ci
rev: main
hooks:
- id: phylum
stages: [pre-push]
# Optional: Specify the dependency file pattern for your repository
files: |
(?x)^(
Cargo\.lock|
)$
# Optional: Specify additional arguments to be passed to `phylum-ci`
args:
- -vv
- --depfile=Cargo.lock
- --audit
- --force-analysis
- --all-deps
verbose: true
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ use sargon::IsBackupResultFailed;
/// Reference for iOS: it is a combination of `BackupStatus` and `BackupResult` (all in one).
#[derive(Clone, PartialEq, Eq, uniffi::Record)]
pub struct BackupResult {
/// The identifier of the backup.
pub save_identifier: String,

/// Whether this backup matches the one on Profile.
pub is_current: bool,

Expand All @@ -21,7 +18,6 @@ pub struct BackupResult {
impl From<InternalBackupResult> for BackupResult {
fn from(internal: InternalBackupResult) -> Self {
Self {
save_identifier: internal.save_identifier,
is_current: internal.is_current.0,
is_failed: internal.is_failed.0,
}
Expand All @@ -31,7 +27,6 @@ impl From<InternalBackupResult> for BackupResult {
impl From<BackupResult> for InternalBackupResult {
fn from(backup_result: BackupResult) -> Self {
InternalBackupResult {
save_identifier: backup_result.save_identifier,
is_current: IsBackupResultCurrent(backup_result.is_current),
is_failed: IsBackupResultFailed(backup_result.is_failed),
}
Expand Down
4 changes: 0 additions & 4 deletions crates/sargon/src/security_center/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ mod tests {
#[test]
fn problem_5() {
let failed_backup = BackupResult::new(
"f",
IsBackupResultCurrent(true),
IsBackupResultFailed(true),
);
let success_backup = BackupResult::new(
"s",
IsBackupResultCurrent(true),
IsBackupResultFailed(false),
);
Expand Down Expand Up @@ -225,12 +223,10 @@ mod tests {
#[test]
fn problem_7() {
let current_backup = BackupResult::new(
"c",
IsBackupResultCurrent(true),
IsBackupResultFailed(false),
);
let outdated_backup = BackupResult::new(
"o",
IsBackupResultCurrent(false),
IsBackupResultFailed(false),
);
Expand Down
17 changes: 2 additions & 15 deletions crates/sargon/src/security_center/support/backup_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use crate::prelude::*;
/// Reference for iOS: it is a combination of `BackupStatus` and `BackupResult` (all in one).
#[derive(Debug, Clone, PartialEq)]
pub struct BackupResult {
/// The identifier of the backup.
pub save_identifier: String,

/// Whether this backup matches the one on Profile.
pub is_current: IsBackupResultCurrent,

Expand All @@ -20,12 +17,10 @@ decl_bool_type!(IsBackupResultFailed, false);

impl BackupResult {
pub fn new(
save_identifier: impl AsRef<str>,
is_current: IsBackupResultCurrent,
is_failed: IsBackupResultFailed,
) -> Self {
Self {
save_identifier: save_identifier.as_ref().to_owned(),
is_current,
is_failed,
}
Expand All @@ -34,19 +29,11 @@ impl BackupResult {

impl HasSampleValues for BackupResult {
fn sample() -> Self {
Self::new(
String::sample(),
IsBackupResultCurrent(true),
IsBackupResultFailed(false),
)
Self::new(IsBackupResultCurrent(true), IsBackupResultFailed(false))
}

fn sample_other() -> Self {
Self::new(
String::sample_other(),
IsBackupResultCurrent(false),
IsBackupResultFailed(true),
)
Self::new(IsBackupResultCurrent(false), IsBackupResultFailed(true))
}
}

Expand Down

0 comments on commit fe1132e

Please sign in to comment.