Skip to content

Commit

Permalink
remove some cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Nov 13, 2023
1 parent a6f218e commit c6cd9dd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 149 deletions.
4 changes: 2 additions & 2 deletions crates/starkwhale-alert/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ pub async fn get_formatted_text(emitted_event: EmittedEvent, token: &Token) -> S

fn to_rounded(amount: BigUint, pow: u32) -> BigUint {
let power = 10_u128.pow(pow);
let amount = amount.clone() / power;
let rounding = amount.clone() / (power / 10) % amount.clone();
let amount = &amount / power;
let rounding = &amount / (power / 10) % &amount;
if rounding > BigUint::from_u8(5).unwrap() {
amount + 1_u128
} else {
Expand Down
2 changes: 1 addition & 1 deletion crates/twitter-login/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async fn callback(
.await
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?;
// set context for use with twitter API
println!("{:?}", token.clone());
println!("{:?}", &token);
ctx.lock().unwrap().token = Some(token);

Ok(Redirect::to("/debug_token".parse().unwrap()))
Expand Down
146 changes: 0 additions & 146 deletions src/api.rs

This file was deleted.

0 comments on commit c6cd9dd

Please sign in to comment.