diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 0429ac2..9f7b3e4 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -70,7 +70,7 @@ pub(crate) async fn run(data: Arc>) { Ok(data) => data, Err(e) => panic!("{}", e), }; - let message = Message::Info("Config reloaded".to_string()); + let message = Message::Info("Config reloaded".to_owned()); if !write.messages.contains(&message) { write.messages.push(message); }; @@ -106,7 +106,7 @@ pub(crate) async fn run(data: Arc>) { continue } }; - let message = Message::Info("Communities reloaded".to_string()); + let message = Message::Info("Communities reloaded".to_owned()); if !read.messages.contains(&message) { drop(read); let mut write = data.write().await; diff --git a/src/config/mod.rs b/src/config/mod.rs index d592611..8699202 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -32,7 +32,7 @@ impl Config { impl Default for Config { fn default() -> Self { Config { - instance: "".to_string(), + instance: "".to_owned(), status_post_url: None, config_reload_seconds: 21600, protected_communities: vec![], diff --git a/src/jnovel/mod.rs b/src/jnovel/mod.rs index 76283e3..abd3ffe 100644 --- a/src/jnovel/mod.rs +++ b/src/jnovel/mod.rs @@ -12,13 +12,13 @@ static PAST_DAYS_ELIGIBLE: u8 = 4; macro_rules! api_url { () => { - "https://labs.j-novel.club/app/v1".to_string() + "https://labs.j-novel.club/app/v1".to_owned() }; } macro_rules! jnc_base_url { () => { - "https://j-novel.club".to_string() + "https://j-novel.club".to_owned() }; } diff --git a/src/lemmy/mod.rs b/src/lemmy/mod.rs index 9617b2f..2cf2bca 100644 --- a/src/lemmy/mod.rs +++ b/src/lemmy/mod.rs @@ -48,7 +48,7 @@ pub(crate) async fn login(credentials: &Credentials, instance: &str) -> Result Result Ok(Lemmy { jwt_token: token.clone(), - instance: instance.to_string(), + instance: instance.to_owned(), }), None => panic!("Login did not return JWT token. Are the credentials valid?") } diff --git a/src/main.rs b/src/main.rs index b7c164c..e3418e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,7 @@ impl SharedData { SharedData { messages: vec![], config: Config { - instance: "".to_string(), + instance: "".to_owned(), status_post_url: None, config_reload_seconds: 0, protected_communities: vec![], @@ -98,7 +98,7 @@ async fn main() { tui_thread.abort(); data = persistent_data.read().await.clone(); - data.messages.push(Message::Error("Bot crashed due to unknown Error, restarting thread after wait...".to_string())); + data.messages.push(Message::Error("Bot crashed due to unknown Error, restarting thread after wait...".to_owned())); sleep(Duration::seconds(5).to_std().expect("Conversion should always work since static")).await; } } diff --git a/src/post_history/mod.rs b/src/post_history/mod.rs index 180c71c..8ba1fa5 100644 --- a/src/post_history/mod.rs +++ b/src/post_history/mod.rs @@ -71,7 +71,7 @@ impl SeriesHistory { } pub(crate) fn set_series(&mut self, series: &str, data: PostHistory) { - self.series.entry(series.to_string()).and_modify(|val| { + self.series.entry(series.to_owned()).and_modify(|val| { *val = data.clone() }) .or_insert(data); @@ -88,14 +88,14 @@ impl PostHistory { match self.parts.get(part) { Some(history) => history.clone(), None => PostHistoryInner { - volume: "".to_string(), - chapter: "".to_string(), + volume: "".to_owned(), + chapter: "".to_owned(), } } } pub(crate) fn set_part(&mut self, part: &str, data: PostHistoryInner) { - self.parts.entry(part.to_string()).and_modify(|val| { + self.parts.entry(part.to_owned()).and_modify(|val| { *val = data.clone() }) .or_insert(data);