diff --git a/src/db.rs b/src/db.rs index a64dd2b..a922a94 100644 --- a/src/db.rs +++ b/src/db.rs @@ -242,9 +242,10 @@ pub async fn db_writer( event.get_author_prefix() ); } else { - info!("rejecting event, author ({:?} / {:?}) verification invalid (expired/wrong domain)", - uv.name.to_string(), - event.get_author_prefix() + info!( + "rejecting event, author ({:?} / {:?}) verification invalid (expired/wrong domain)", + uv.name.to_string(), + event.get_author_prefix() ); notice_tx .try_send(Notice::blocked( @@ -391,9 +392,9 @@ pub fn write_event(conn: &mut PooledConnection, e: &Event) -> Result { // if tagvalue is lowercase hex; if is_lower_hex(tagval) && (tagval.len() % 2 == 0) { tx.execute( - "INSERT OR IGNORE INTO tag (event_id, name, value_hex) VALUES (?1, ?2, ?3)", - params![ev_id, &tagname, hex::decode(tagval).ok()], - )?; + "INSERT OR IGNORE INTO tag (event_id, name, value_hex) VALUES (?1, ?2, ?3)", + params![ev_id, &tagname, hex::decode(tagval).ok()], + )?; } else { tx.execute( "INSERT OR IGNORE INTO tag (event_id, name, value) VALUES (?1, ?2, ?3)", @@ -608,7 +609,10 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec>) { let str_clause = format!("value IN ({})", repeat_vars(str_vals.len())); let blob_clause = format!("value_hex IN ({})", repeat_vars(blob_vals.len())); // find evidence of the target tag name/value existing for this event. - let tag_clause = format!("e.id IN (SELECT e.id FROM event e LEFT JOIN tag t on e.id=t.event_id WHERE hidden!=TRUE and (name=? AND ({} OR {})))", str_clause, blob_clause); + let tag_clause = format!( + "e.id IN (SELECT e.id FROM event e LEFT JOIN tag t on e.id=t.event_id WHERE hidden!=TRUE and (name=? AND ({} OR {})))", + str_clause, blob_clause + ); // add the tag name as the first parameter params.push(Box::new(key.to_string())); // add all tag values that are plain strings as params