Skip to content

Commit

Permalink
chore: fix some clippy warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
helio-frota authored and dejanb committed Feb 2, 2024
1 parent 3e804a3 commit 2324978
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/tests/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const GUAC_URL: &str = "http://localhost:8085/query";

#[no_mangle]
pub fn guac_url() -> String {
std::env::var("GUAC_URL").unwrap_or_else(|_| GUAC_URL.to_string())
}
8 changes: 4 additions & 4 deletions lib/tests/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ async fn transitive_dependents() -> Result<(), anyhow::Error> {

for path in paths {
for segment in path {
print!("{} ", segment.to_string());
print!("{} ", segment);
}
println!()
}
Expand All @@ -245,7 +245,7 @@ async fn transitive_dependents() -> Result<(), anyhow::Error> {
.await?;

for dependent in dependents {
println!("{}", dependent.to_string())
println!("{}", dependent)
}

Ok(())
Expand Down Expand Up @@ -335,7 +335,7 @@ async fn transitive_affected() -> Result<(), anyhow::Error> {

for path in paths {
for segment in path {
print!("{} ", segment.to_string());
print!("{} ", segment);
}
println!()
}
Expand All @@ -346,7 +346,7 @@ async fn transitive_affected() -> Result<(), anyhow::Error> {
.await?;

for affected in affected {
println!("{}", affected.to_string())
println!("{}", affected)
}

Ok(())
Expand Down
8 changes: 4 additions & 4 deletions lib/tests/spog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use guac::client::GuacClient;
#[ignore]
#[tokio::test]
async fn product_by_cve() -> Result<(), anyhow::Error> {
let client = GuacClient::new(&"http://localhost:8085/query");
let client = GuacClient::new("http://localhost:8085/query");

let result = client.semantic().product_by_cve("cve-2022-2284").await?;
println!("result {:?}", result);
Expand All @@ -22,7 +22,7 @@ async fn product_by_cve() -> Result<(), anyhow::Error> {
#[ignore]
#[tokio::test]
async fn find_vulnerability() -> Result<(), anyhow::Error> {
let client = GuacClient::new(&"http://localhost:8085/query");
let client = GuacClient::new("http://localhost:8085/query");

let result = client
.semantic()
Expand All @@ -39,7 +39,7 @@ async fn find_vulnerability() -> Result<(), anyhow::Error> {
#[ignore]
#[tokio::test]
async fn find_vulnerability_by_sbom_uri() -> Result<(), anyhow::Error> {
let client = GuacClient::new(&"http://localhost:8085/query");
let client = GuacClient::new("http://localhost:8085/query");

let result = client
.semantic()
Expand All @@ -55,7 +55,7 @@ async fn find_vulnerability_by_sbom_uri() -> Result<(), anyhow::Error> {
#[ignore]
#[tokio::test]
async fn find_dependent_product() -> Result<(), anyhow::Error> {
let client = GuacClient::new(&"http://localhost:8085/query");
let client = GuacClient::new("http://localhost:8085/query");

let result = client
.semantic()
Expand Down

0 comments on commit 2324978

Please sign in to comment.