delint
This commit is contained in:
parent
295a7791be
commit
1237f8e701
|
@ -160,20 +160,14 @@ impl Store {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let host = match post.url_host() {
|
let Some(host) = post.url_host() else {
|
||||||
Some(host) => host,
|
tracing::warn!("no url_host");
|
||||||
None => {
|
return;
|
||||||
tracing::warn!("no url_host");
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let timestamp = match post.timestamp() {
|
let Some(timestamp) = post.timestamp() else {
|
||||||
Some(timestamp) => timestamp,
|
tracing::warn!("no timestamp");
|
||||||
None => {
|
return;
|
||||||
tracing::warn!("no timestamp");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let hour = timestamp.to_utc().timestamp() as u64 / 3600;
|
let hour = timestamp.to_utc().timestamp() as u64 / 3600;
|
||||||
let until = current_hour();
|
let until = current_hour();
|
||||||
|
@ -389,9 +383,7 @@ impl Store {
|
||||||
|
|
||||||
let mut results = Vec::with_capacity(names.len());
|
let mut results = Vec::with_capacity(names.len());
|
||||||
for name in names {
|
for name in names {
|
||||||
let hash_values = if let Some(Value::Bulk(hash_values)) = values.next() {
|
let Some(Value::Bulk(hash_values)) = values.next() else {
|
||||||
hash_values
|
|
||||||
} else {
|
|
||||||
panic!("hash_values");
|
panic!("hash_values");
|
||||||
};
|
};
|
||||||
let hash_values = hash_values.iter()
|
let hash_values = hash_values.iter()
|
||||||
|
|
|
@ -141,9 +141,7 @@ async fn main() {
|
||||||
|
|
||||||
let author: activitypub::Actor = if let Some(author_url) = &post.attributed_to {
|
let author: activitypub::Actor = if let Some(author_url) = &post.attributed_to {
|
||||||
if let Ok(url) = Url::parse(author_url) {
|
if let Ok(url) = Url::parse(author_url) {
|
||||||
let host = if let Some(host) = url.host_str() {
|
let Some(host) = url.host_str() else {
|
||||||
host
|
|
||||||
} else {
|
|
||||||
tracing::error!("No host in author {author_url}");
|
tracing::error!("No host in author {author_url}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -183,9 +181,7 @@ async fn main() {
|
||||||
} else {
|
} else {
|
||||||
"update"
|
"update"
|
||||||
}.to_string();
|
}.to_string();
|
||||||
let encodable_post = if let Ok(post) = feed::EncodablePost::from_post(event_type, feed_post) {
|
let Ok(encodable_post) = feed::EncodablePost::from_post(event_type, feed_post) else {
|
||||||
post
|
|
||||||
} else {
|
|
||||||
tracing::error!("Cannot serialize post {id}");
|
tracing::error!("Cannot serialize post {id}");
|
||||||
metrics::counter!("sieve_activity", 1, "type" => "serialize_error");
|
metrics::counter!("sieve_activity", 1, "type" => "serialize_error");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue