Skip to content

Commit

Permalink
Bump chrono from 0.4.34 to 0.4.37 (#678)
Browse files Browse the repository at this point in the history
* Bump chrono from 0.4.34 to 0.4.37

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.34 to 0.4.37.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.34...v0.4.37)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixed deprecated dependencies.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SamTV12345 <40429738+samtv12345@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and SamTV12345 authored Apr 2, 2024
1 parent be21f16 commit 5438aa2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 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 @@ -37,7 +37,7 @@ substring = "1.4.5"
opml = "1.1.6"
rand = "0.8.5"
env_logger = "0.11.3"
chrono = {version = "0.4.34", default-features=false, features = ["serde"]}
chrono = {version = "0.4.37", default-features=false, features = ["serde"]}
actix-web-actors = "4.3.0"
rss = "2.0.7"
frankenstein = "0.30.5"
Expand Down
5 changes: 3 additions & 2 deletions src/gpodder/episodes/gpodder_episodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::models::session::Session;
use crate::utils::error::{map_r2d2_error, CustomError};
use crate::utils::time::get_current_timestamp;
use crate::DbPool;
use chrono::NaiveDateTime;
use chrono::{DateTime};

#[derive(Serialize, Deserialize)]
pub struct EpisodeActionResponse {
Expand Down Expand Up @@ -45,7 +45,8 @@ pub async fn get_episode_actions(
return Err(CustomError::Forbidden);
}

let since_date = NaiveDateTime::from_timestamp_opt(since.since, 0);
let since_date = DateTime::from_timestamp(since.since, 0)
.map(|v| v.naive_utc());
let actions = Episode::get_actions_by_username(
username.clone(),
&mut pool.get().unwrap(),
Expand Down
6 changes: 3 additions & 3 deletions src/models/session.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::dbconfig::schema::sessions;
use crate::utils::error::{map_db_error, CustomError};
use crate::{execute_with_conn, DBType as DbConnection};
use chrono::{NaiveDateTime, Utc};
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::ExpressionMethods;
use diesel::QueryDsl;
use diesel::{Insertable, Queryable, RunQueryDsl};
Expand All @@ -20,8 +20,8 @@ impl Session {
Self {
username,
session_id: Uuid::new_v4().to_string(),
expires: NaiveDateTime::from_timestamp_opt(Utc::now().timestamp() + 60 * 60 * 24, 0)
.unwrap(),
expires: DateTime::from_timestamp(Utc::now().timestamp() + 60 * 60 * 24, 0)
.map(|v|v.naive_utc()).unwrap(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/models/subscription.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::gpodder::subscription::subscriptions::SubscriptionUpdateRequest;
use actix_web::web;
use chrono::{NaiveDateTime, Utc};
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::ExpressionMethods;
use diesel::{BoolExpressionMethods, QueryDsl, RunQueryDsl};
use std::io::Error;
Expand Down Expand Up @@ -75,7 +75,7 @@ impl SubscriptionChangesToClient {
since: i32,
conn: &mut DbConnection,
) -> Result<SubscriptionChangesToClient, Error> {
let since = NaiveDateTime::from_timestamp_opt(since as i64, 0).unwrap();
let since = DateTime::from_timestamp(since as i64, 0).map(|v|v.naive_utc()).unwrap();
let res: Vec<Subscription> = subscriptions::table
.filter(subscriptions::username.eq(username))
.filter(
Expand Down

0 comments on commit 5438aa2

Please sign in to comment.