This commit is contained in:
2023-05-09 00:09:06 +02:00
parent 678b65146b
commit de757e7e50
3 changed files with 4 additions and 4 deletions

View File

@@ -127,7 +127,7 @@ impl FromVecExpression<Book> for Book {
}, },
uploaded: match &value[2] { uploaded: match &value[2] {
sql_parse::Expression::String(v) => { 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() .unwrap()
.date() .date()
} }

View File

@@ -83,7 +83,7 @@ async fn process<T>(
where where
T: Debug + FromVecExpression<T> + Update, T: Debug + FromVecExpression<T> + Update,
{ {
if deps.len() != 0 { if !deps.is_empty() {
loop { loop {
let mut some_failed = false; let mut some_failed = false;
let mut some_none = false; let mut some_none = false;
@@ -155,7 +155,7 @@ where
match value.update(&client, source_id).await { match value.update(&client, source_id).await {
Ok(_) => { Ok(_) => {
// log::info!("{:?}", value); // log::info!("{:?}", value);
()
} }
Err(err) => { Err(err) => {
log::error!("Update error: {:?} : {:?}", value, err); log::error!("Update error: {:?} : {:?}", value, err);

View File

@@ -21,7 +21,7 @@ pub fn remove_wrong_chars(s: &str) -> String {
} }
pub fn parse_lang(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 { pub fn fix_annotation_text(text: &str) -> String {