Skip to content

Commit

Permalink
Fixed lint errors in Rust v1.79
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Jul 10, 2024
1 parent fd39b47 commit 1826552
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/controllers/podcast_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ pub async fn retrieve_podcast_sample_format(
date: "2021-01-01".to_string(),
summary: "A podcast about homelabing".to_string(),
title: "The homelab podcast".to_string(),
description: "test".to_string(),
keywords: "computer, server, apps".to_string(),
language: "en".to_string(),
explicit: "false".to_string(),
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ use crate::models::settings::Setting;
use crate::models::web_socket_message::Lobby;
use crate::service::environment_service::EnvironmentService;
use crate::service::file_service::FileService;
use crate::service::jwkservice::JWKService;
use crate::service::logging_service::init_logging;

use crate::service::notification_service::NotificationService;
Expand Down Expand Up @@ -352,7 +351,6 @@ async fn main() -> std::io::Result<()> {
.app_data(Data::new(Mutex::new(notification_service.clone())))
.app_data(Data::new(Mutex::new(settings_service.clone())))
.app_data(data_pool.clone())
.app_data(Data::new(Mutex::new(JWKService::new())))
.wrap(Condition::new(cfg!(debug_assertions), Logger::default()))
})
.workers(4)
Expand Down
5 changes: 0 additions & 5 deletions src/models/misc_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ use crate::models::podcasts::Podcast;
use chrono::NaiveDateTime;
use utoipa::ToSchema;

// decode request data
#[derive(Deserialize)]
pub struct UserData {
pub username: String,
}
// this is to insert users to database
#[derive(Serialize, Deserialize)]
pub struct NewUser {
Expand Down
3 changes: 2 additions & 1 deletion src/models/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ impl Setting {
do_retry(|| {
insert_into(settings)
.values((
id.eq(1),
id.eq(DEFAULT_SETTINGS.id),
auto_update.eq(DEFAULT_SETTINGS.auto_update),
auto_download.eq(DEFAULT_SETTINGS.auto_download),
auto_cleanup.eq(DEFAULT_SETTINGS.auto_cleanup),
auto_cleanup_days.eq(DEFAULT_SETTINGS.auto_cleanup_days),
Expand Down
2 changes: 0 additions & 2 deletions src/service/download_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ use crate::utils::error::CustomError;
use crate::utils::file_extension_determination::{determine_file_extension, FileType};

pub struct DownloadService {
pub client_builder: ClientBuilder,
pub file_service: FileService,
}

impl DownloadService {
pub fn new() -> Self {
DownloadService {
client_builder: ClientBuilder::new(),
file_service: FileService::new(),
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/service/file_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ mod tests {

let podcast_episode = PodcastParsed {
title: "Test".to_string(),
description: "Test".to_string(),
language: "".to_string(),
explicit: "false".to_string(),
keywords: "test,test2".to_string(),
Expand Down Expand Up @@ -639,7 +638,6 @@ mod tests {

let podcast_episode = PodcastParsed {
title: "Test".to_string(),
description: "Test".to_string(),
language: "en".to_string(),
explicit: "false".to_string(),
keywords: "test,test2".to_string(),
Expand Down
16 changes: 0 additions & 16 deletions src/service/jwkservice.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/service/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod download_service;
pub mod environment_service;
pub(crate) mod file_service;
pub mod jwkservice;
pub mod logging_service;
pub mod mapping_service;
pub mod notification_service;
Expand Down
1 change: 0 additions & 1 deletion src/service/settings_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ impl SettingsService {
date: "2022-01-01".to_string(),
summary: "A podcast about homelabing".to_string(),
title: "The homelab podcast".to_string(),
description: "test".to_string(),
keywords: "computer, server, apps".to_string(),
language: "en".to_string(),
explicit: "false".to_string(),
Expand Down
3 changes: 0 additions & 3 deletions src/utils/rss_feed_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use rss::Channel;
#[derive(Clone)]
pub struct PodcastParsed {
pub title: String,
pub description: String,
pub language: String,
pub explicit: String,
pub keywords: String,
Expand All @@ -16,7 +15,6 @@ pub struct RSSFeedParser;
impl RSSFeedParser {
pub fn parse_rss_feed(rss_feed: Channel) -> PodcastParsed {
let title = rss_feed.title;
let description = rss_feed.description;
let language = rss_feed.language.unwrap_or("en".to_string());
let build_date = rss_feed.last_build_date.unwrap_or("".to_string());
let keywords = match rss_feed.itunes_ext.clone() {
Expand All @@ -35,7 +33,6 @@ impl RSSFeedParser {

PodcastParsed {
title,
description,
language,
explicit,
keywords,
Expand Down

0 comments on commit 1826552

Please sign in to comment.