Skip to content

Commit 9272f91

Browse files
committed
chore: apply clippy fixes
1 parent 9cf0f65 commit 9272f91

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/auth/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Session {
9494
let b64 = general_purpose::STANDARD_NO_PAD.encode(json_bytes);
9595
let raw_digest = crypto::get_digest(&b64.clone().into_bytes());
9696
let digest = general_purpose::STANDARD_NO_PAD.encode(raw_digest);
97-
let session = format!("{}:{}", b64, digest);
97+
let session = format!("{b64}:{digest}");
9898

9999
session
100100
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async fn main() -> Result<()> {
4343
tokio::net::TcpListener::bind(&addr)
4444
.await
4545
.inspect(|_| {
46-
println!("listening on {}", addr);
46+
println!("listening on {addr}");
4747
})
4848
.unwrap_or_else(|e| panic!("Can bind to address {addr} ({e})")),
4949
app.into_make_service(),

src/stripe/create_new_subscription.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub async fn create_customer(name: &str, email: &str) -> Aresult<String> {
2222
let client = Client::new();
2323
let builder = client
2424
.post(url)
25-
.header("Authorization", format!("Basic {}:", secret_key));
25+
.header("Authorization", format!("Basic {secret_key}:"));
2626
let builder = builder.form(&params);
2727
let response: BillingPortalSession = builder.send().await?.json().await?;
2828
Ok(response.id)
@@ -64,7 +64,7 @@ pub async fn get_basic_plan_checkout_session(
6464
let client = Client::new();
6565
let response = client
6666
.post(url)
67-
.header("Authorization", format!("Basic {}", secret_key))
67+
.header("Authorization", format!("Basic {secret_key}"))
6868
.form(&request_payload)
6969
.send()
7070
.await?;

src/stripe/customer_portal_link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub async fn redirect_to_billing_portal(
4040
let client = Client::new();
4141
let response = client
4242
.post(url)
43-
.header("Authorization", format!("Basic {}", secret_key))
43+
.header("Authorization", format!("Basic {secret_key}"))
4444
.form(&request_payload)
4545
.send()
4646
.await?;

src/stripe/webhook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn authenticate_stripe(
158158
let external_digest =
159159
*entries.get("v1").ok_or(Error::msg("digest is missing"))?;
160160
let external_digest = external_digest.as_bytes();
161-
let payload_str = format!("{}.{}", timestamp, message_body);
161+
let payload_str = format!("{timestamp}.{message_body}");
162162
let payload = payload_str.as_bytes();
163163
let signing_secret = env::var("STRIPE_WEBHOOK_SIGNING_SECRET")?;
164164
let mut mac = Hmac::<Sha256>::new_from_slice(signing_secret.as_bytes())?;

0 commit comments

Comments
 (0)