Skip to content

Commit 56c8d6e

Browse files
committed
Refactor code formatting for readability
1 parent 1f4b145 commit 56c8d6e

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

src/bitte_plugin/src/handler/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub struct PublicMetric {
2828
retweet_count: u128,
2929
}
3030

31-
3231
#[derive(Debug, Deserialize, Serialize, Clone)]
3332
pub struct TweetResponse {
3433
/// data
@@ -107,4 +106,4 @@ pub struct User {
107106
pub name: String,
108107
/// pub created_at: String,
109108
pub created_at: String,
110-
}
109+
}

src/bitte_plugin/src/handler/tweet.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use near_client::{
44
client::NearClient,
55
prelude::{AccountId, Finality},
66
};
7-
use reqwest::{ multipart::{Form, Part}, Client
7+
use reqwest::{
8+
multipart::{Form, Part},
9+
Client,
810
};
911
use rocket::serde::json::{json, Json, Value};
1012
use tracing::debug;
@@ -91,26 +93,19 @@ pub async fn mint_tweet_request(tweet_id: Option<String>) -> NetworkResponse {
9193

9294
let client = Client::new();
9395

94-
let form = Form::new()
95-
.part("file", Part::bytes(image).file_name("image.png")
96-
);
96+
let form = Form::new().part("file", Part::bytes(image).file_name("image.png"));
9797

9898
// Return a JSON response
99-
let url ="https://node.lighthouse.storage/api/v0/add?pin=true";
99+
let url = "https://node.lighthouse.storage/api/v0/add?pin=true";
100100
let response = client
101101
.post(url)
102102
.header(
103103
"Content-Type",
104104
format!("multipart/form-data; boundary={}", form.boundary()),
105105
)
106-
.header(
107-
"Encryption", "false",
108-
)
109-
.header(
110-
"Mime-Type", "null",
111-
).header(
112-
"Authorization", format!("Bearer {}",lighthouse_token),
113-
)
106+
.header("Encryption", "false")
107+
.header("Mime-Type", "null")
108+
.header("Authorization", format!("Bearer {}", lighthouse_token))
114109
.multipart(form)
115110
.send()
116111
.await;

src/bitte_plugin/src/helper.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::error::Error;
2-
use std::marker::{Send, Sync};
3-
use headless_chrome::LaunchOptionsBuilder;
41
use headless_chrome::protocol::cdp::Page;
52
use headless_chrome::Browser;
3+
use headless_chrome::LaunchOptionsBuilder;
64
use serde::{Deserialize, Serialize};
5+
use std::error::Error;
76
use std::ffi::OsStr;
7+
use std::marker::{Send, Sync};
88

99
pub async fn create_twitter_post_image(
1010
url: String,
@@ -18,8 +18,8 @@ pub async fn create_twitter_post_image(
1818

1919
// let mut builder = headless_chrome::LaunchOptions::default_builder();
2020
let options = LaunchOptionsBuilder::default()
21-
.args(vec![OsStr::new("--no-sandbox")])
22-
.build()?;
21+
.args(vec![OsStr::new("--no-sandbox")])
22+
.build()?;
2323
// Set headless mode based on whether it's in test mode
2424
// #[cfg(test)]
2525
// builder.headless(false); // Headful mode for tests

src/near_indexer/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ pub async fn process_near_transaction(
280280
// Notify the user on Twitter if specified
281281
if !mint_data.notify.is_empty() {
282282
let _notification = notifier
283-
.notifier(&mint_data.tweet_id.clone(), &mint_data.notify)
284-
.await;
285-
info!("notified: {},\n{:?}",mint_data.notify,_notification);
283+
.notifier(&mint_data.tweet_id.clone(), &mint_data.notify)
284+
.await;
285+
info!("notified: {},\n{:?}", mint_data.notify, _notification);
286286
}
287287
return Ok(false);
288288
}

0 commit comments

Comments
 (0)