Skip to content

Commit

Permalink
chore: fix clippy warning and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
notmarek committed Sep 3, 2023
1 parent 95ef659 commit 1552af5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/api/search.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::{
models::file::FileActions,
Response, VerifiedAuthData,
};
use crate::{models::file::FileActions, Response, VerifiedAuthData};
use actix_web::{error::ErrorInternalServerError, post};
use actix_web::{web, HttpResponse};
use entity::file::Model as File;
Expand Down
5 changes: 3 additions & 2 deletions src/utils/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ pub async fn scan_file(file_path: &Path) -> Result<File, String> {
.unwrap_or_default()
);
Ok(File {
last_update: chrono::NaiveDateTime::from_timestamp(
last_update: chrono::NaiveDateTime::from_timestamp_opt(
metadata
.modified()
.unwrap()
.duration_since(SystemTime::UNIX_EPOCH)
.map_err(|e| e.to_string())?
.as_secs() as i64,
0,
),
)
.unwrap_or_default(),
title: elements
.get(anitomy::ElementCategory::AnimeTitle)
.map(|e| e.to_string()),
Expand Down

0 comments on commit 1552af5

Please sign in to comment.