Skip to content

Commit

Permalink
fix: use DateTIme::parse_from_str
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovyerus committed Mar 19, 2024
1 parent d6a8d48 commit 907c582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/structs/digital_item.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::util::make_string_fs_safe;

use chrono::{Datelike, TimeZone, Utc};
use chrono::{DateTime, Datelike};
use serde::{self, Deserialize};
use std::{collections::HashMap, path::Path};

Expand Down Expand Up @@ -47,7 +47,7 @@ impl DigitalItem {

pub fn release_year(&self) -> String {
match &self.package_release_date {
Some(d) => match Utc.datetime_from_str(d, FORMAT) {
Some(d) => match DateTime::parse_from_str(d, FORMAT) {
Ok(dt) => dt.year().to_string(),
Err(_) => String::from("0000"),
},
Expand Down
1 change: 1 addition & 0 deletions src/cmds/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct Args {
id: String,
}

#[allow(dead_code)]
pub async fn command(_args: Args) -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}

0 comments on commit 907c582

Please sign in to comment.