From d5d29fb0161a77e6209ab7d3f8dad4daed746ce7 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Fri, 8 Apr 2022 09:20:42 +0200 Subject: [PATCH] fix warnings --- Cargo.toml | 1 + src/invoice.rs | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c134102..fc1ecea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,3 +26,4 @@ bytes = "1.1.0" [dev-dependencies] tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread"] } dotenv = "0.15.0" +anyhow = "1.0.56" diff --git a/src/invoice.rs b/src/invoice.rs index ced3505..13dc4b6 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -891,24 +891,21 @@ impl super::Client { #[cfg(test)] mod tests { - use crate::{invoice::*, Client, HeaderParams}; + use crate::{Client, HeaderParams}; async fn create_client() -> Client { dotenv::dotenv().ok(); let clientid = std::env::var("PAYPAL_CLIENTID").unwrap(); let secret = std::env::var("PAYPAL_SECRET").unwrap(); - let client = Client::new(clientid, secret, true); - - client + Client::new(clientid, secret, true) } #[tokio::test] - async fn test_invoice() { + async fn test_invoice() -> anyhow::Result<()> { let mut client = create_client().await; - let list = client.list_invoices(1, 10, HeaderParams::default()).await.unwrap(); - - println!("{:#?}", list); + let _list = client.list_invoices(1, 10, HeaderParams::default()).await?; + Ok(()) } }