mirror of
https://github.com/flibusta-apps/library_updater.git
synced 2025-12-06 07:45:35 +01:00
Optimize
This commit is contained in:
@@ -127,7 +127,7 @@ impl FromVecExpression<Book> for Book {
|
||||
},
|
||||
uploaded: match &value[2] {
|
||||
sql_parse::Expression::String(v) => {
|
||||
NaiveDateTime::parse_from_str(&v.value.to_string(), "%Y-%m-%d %H:%M:%S")
|
||||
NaiveDateTime::parse_from_str(&v.value, "%Y-%m-%d %H:%M:%S")
|
||||
.unwrap()
|
||||
.date()
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ async fn process<T>(
|
||||
where
|
||||
T: Debug + FromVecExpression<T> + Update,
|
||||
{
|
||||
if deps.len() != 0 {
|
||||
if !deps.is_empty() {
|
||||
loop {
|
||||
let mut some_failed = false;
|
||||
let mut some_none = false;
|
||||
@@ -155,7 +155,7 @@ where
|
||||
match value.update(&client, source_id).await {
|
||||
Ok(_) => {
|
||||
// log::info!("{:?}", value);
|
||||
()
|
||||
|
||||
}
|
||||
Err(err) => {
|
||||
log::error!("Update error: {:?} : {:?}", value, err);
|
||||
|
||||
@@ -21,7 +21,7 @@ pub fn remove_wrong_chars(s: &str) -> String {
|
||||
}
|
||||
|
||||
pub fn parse_lang(s: &str) -> String {
|
||||
s.replace('-', "").replace('~', "").to_lowercase()
|
||||
s.replace(['-', '~'], "").to_lowercase()
|
||||
}
|
||||
|
||||
pub fn fix_annotation_text(text: &str) -> String {
|
||||
|
||||
Reference in New Issue
Block a user