Skip to content

Commit f3d6c2a

Browse files
authored
Merge pull request #2 from Juanperias/main
refactor: clippy errors
2 parents bf6e809 + 80a93aa commit f3d6c2a

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/cangrebot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub async fn set_daily(
1111
challenge: DailyChallenge,
1212
client: &Client,
1313
) {
14-
let req = json!({
14+
let request = json!({
1515
"title": format!("Reto #{day} - {}", challenge.question.title),
1616
"message": challenge.to_string(),
1717
"tag_name": challenge.question.difficulty.to_string(),
@@ -21,7 +21,7 @@ pub async fn set_daily(
2121
.post(endpoint)
2222
.header("content-type", "application/json")
2323
.header("Authorization", apikey)
24-
.body(serde_json::to_string(&req).unwrap())
24+
.body(serde_json::to_string(&request).unwrap())
2525
.send()
2626
.await
2727
.inspect_err(|e| console_warn!("Reqwest Error: {e:?}"))

src/challenge.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Display for DailyChallenge {
9595
.unwrap_or_default();
9696

9797
f.write_fmt(format_args!(
98-
r#"{parsed}
98+
r"{parsed}
9999
100100
> Enlace:
101101
> https://leetcode.com{}
@@ -104,7 +104,7 @@ impl Display for DailyChallenge {
104104
> {test_cases}
105105
106106
{code}
107-
"#,
107+
",
108108
self.link
109109
))
110110
}

src/daily.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::challenge::{DailyChallenge, GraphQLResponse};
66

77
const LETCODE_URL: &str = "https://leetcode.com";
88

9-
const DAILY_QUERY: &str = r#"query {
9+
const DAILY_QUERY: &str = r"query {
1010
activeDailyCodingChallengeQuestion {
1111
date
1212
link
@@ -30,7 +30,7 @@ const DAILY_QUERY: &str = r#"query {
3030
sampleTestCase
3131
}
3232
}
33-
}"#;
33+
}";
3434

3535
// Strategy to fetch from https://github.com/JacobLinCool/LeetCode-Query
3636
pub async fn get_daily(client: &Client) -> DailyChallenge {

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ mod cangrebot;
1111
mod challenge;
1212
mod daily;
1313

14+
/// # Panics
15+
/// This may panic if the environment variable `APIKEY` is not found, or if `CANGREBOT_API_ENDPOINT` is also missing.
1416
#[event(scheduled)]
1517
pub async fn main(_e: ScheduledEvent, env: Env, _ctx: ScheduleContext) {
1618
// Custom panic

0 commit comments

Comments
 (0)