Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Aug 11, 2024
1 parent 66b4dff commit c5a5aab
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl TryInto<RedacterOptions> for RedacterArgs {
fn try_into(self) -> Result<RedacterOptions, Self::Error> {
let mut provider_options =
Vec::with_capacity(self.redact.as_ref().map(Vec::len).unwrap_or(0));
for options in self.redact.unwrap_or_else(Vec::new) {
for options in self.redact.unwrap_or_default() {
let redacter_options = match options {
RedacterType::GcpDlp => match self.gcp_project_id {
Some(ref project_id) => {
Expand Down
1 change: 0 additions & 1 deletion src/commands/copy_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use futures::Stream;
use gcloud_sdk::prost::bytes;
use indicatif::*;
use std::error::Error;
use std::fmt::Write;
use std::time::Duration;

pub struct CopyCommandResult {
Expand Down
4 changes: 2 additions & 2 deletions src/redacters/aws_comprehend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ mod tests {
)
.await?;

let redacted_content = redacter.redact(input).await?;
match redacted_content {
let redacted_item = redacter.redact(input).await?;
match redacted_item.content {
RedacterDataItemContent::Value(value) => {
assert_eq!(value, "Hello, XXXX");
}
Expand Down
4 changes: 2 additions & 2 deletions src/redacters/gcp_dlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ mod tests {
)
.await?;

let redacted_content = redacter.redact(input).await?;
match redacted_content {
let redacted_item = redacter.redact(input).await?;
match redacted_item.content {
RedacterDataItemContent::Value(value) => {
assert_eq!(value, "Hello, [REDACTED]");
}
Expand Down
4 changes: 2 additions & 2 deletions src/redacters/gemini_llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ mod tests {
)
.await?;

let redacted_content = redacter.redact(input).await?;
match redacted_content {
let redacted_item = redacter.redact(input).await?;
match redacted_item.content {
RedacterDataItemContent::Value(value) => {
assert_eq!(value.trim(), "Hello, [REDACTED]");
}
Expand Down
4 changes: 2 additions & 2 deletions src/redacters/ms_presidio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ mod tests {
)
.await?;

let redacted_content = redacter.redact(input).await?;
match redacted_content {
let redacted_item = redacter.redact(input).await?;
match redacted_item.content {
RedacterDataItemContent::Value(value) => {
assert_eq!(value, "Hello, XXXX");
}
Expand Down
4 changes: 2 additions & 2 deletions src/redacters/open_ai_llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ mod tests {
)
.await?;

let redacted_content = redacter.redact(input).await?;
match redacted_content {
let redacted_item = redacter.redact(input).await?;
match redacted_item.content {
RedacterDataItemContent::Value(value) => {
assert_eq!(value.trim(), "Hello, [REDACTED]");
}
Expand Down

0 comments on commit c5a5aab

Please sign in to comment.