Skip to content

Commit

Permalink
Bump diesel_migrations from 2.1.0 to 2.2.0 (#790)
Browse files Browse the repository at this point in the history
* Bump diesel_migrations from 2.1.0 to 2.2.0

Bumps [diesel_migrations](https://github.com/diesel-rs/diesel) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/diesel-rs/diesel/releases)
- [Changelog](https://github.com/diesel-rs/diesel/blob/master/CHANGELOG.md)
- [Commits](diesel-rs/diesel@v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: diesel_migrations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fixed lint errors and deprecated api

* Fixed lint errors in Rust v1.79

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SamTV12345 <[email protected]>
  • Loading branch information
dependabot[bot] and SamTV12345 authored Jul 17, 2024
1 parent 75ec5c5 commit 76776d3
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 58 deletions.
87 changes: 71 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ base64 = "0.22.1"
uuid = {version="1.9.1", features = ["v4", "serde"]}
libsqlite3-sys = {version = "0.28.0", features = ["bundled"], optional = true}
r2d2_postgres = {version = "0.18.1", optional = true}
diesel_migrations = "2.1.0"
diesel_migrations = "2.2.0"
actix-files = "0.6.6"
actix-web = {version="4.8.0", features=["rustls"]}
jsonwebtoken = {version="9.3.0"}
Expand Down
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
10 changes: 6 additions & 4 deletions src/controllers/settings_controller.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Display;
use crate::models::podcasts::Podcast;
use crate::models::settings::Setting;
use crate::models::user::User;
Expand Down Expand Up @@ -265,15 +266,16 @@ pub enum ReplacementStrategy {
ReplaceWithDash,
}

impl ToString for ReplacementStrategy {
fn to_string(&self) -> String {
match self {
impl Display for ReplacementStrategy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let str = match self {
ReplacementStrategy::ReplaceWithDashAndUnderscore => {
"replace-with-dash-and-underscore".to_string()
}
ReplacementStrategy::Remove => "remove".to_string(),
ReplacementStrategy::ReplaceWithDash => "replace-with-dash".to_string(),
}
};
write!(f, "{}", str)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dbconfig/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#[path = "schemas/sqlite/schema.rs"]
pub mod schema;
use diesel::QueryResult;

#[derive(diesel::MultiConnection)]
pub enum DBType {
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
2 changes: 1 addition & 1 deletion src/models/favorites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl Favorite {
},
}

sql_function!(fn lower(x: Text) -> Text);
define_sql_function!(fn lower(x: Text) -> Text);

if let Some(title) = title {
use crate::dbconfig::schema::podcasts::dsl::name as podcasttitle;
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
6 changes: 2 additions & 4 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 Expand Up @@ -263,7 +261,7 @@ impl DownloadService {
}
Err(e) => {
log::error!("Error getting track number: {:?}", e);
CustomError::Conflict(e.to_string());
e.to_string();
}
}

Expand All @@ -273,7 +271,7 @@ impl DownloadService {
Err(e) => {
log::error!("Error reading metadata: {:?}", e);
let err = CustomError::Conflict(e.to_string());
return Err(err);
Err(err)
}
}

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 76776d3

Please sign in to comment.