Skip to content

Commit

Permalink
fix warnings and add clippy to all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
danitrap committed Dec 28, 2023
1 parent e19c1ba commit 987be11
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/broadcast.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

use crate::config::Config;
use serde_json::json;

Expand Down
2 changes: 2 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

use bytes::Bytes;

const HN_500_URL: &str = "https://hnrss.org/newest?points=500";
Expand Down
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

extern crate dotenv;

use dotenv::dotenv;
Expand Down
6 changes: 4 additions & 2 deletions src/models.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

use crate::utils::strip_html;
use std::collections::{HashSet, LinkedList};
use std::fmt;
Expand Down Expand Up @@ -189,7 +191,7 @@ mod tests {
let mut instance = HackerNews::new();
let item = HnItem::new("title".to_string(), "snippet".to_string(), "".to_string());
let items = vec![item.clone()];
let mut new_items = instance.whats_new(items);
let new_items = instance.whats_new(items);

assert_eq!(new_items, Some(vec![Rc::new(item)]));
assert_eq!(instance.history.len(), 1);
Expand All @@ -215,7 +217,7 @@ mod tests {
"guid 2".to_string(),
);
let items2 = vec![item.clone(), item2.clone()];
let mut new_items2 = instance.whats_new(items2);
let new_items2 = instance.whats_new(items2);

assert_eq!(new_items2, Some(vec![Rc::new(item2)]));
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

pub fn strip_html(s: String) -> String {
let mut in_tag = false;
let mut result = String::new();
Expand Down

0 comments on commit 987be11

Please sign in to comment.