cargo fix lint
This commit is contained in:
parent
c499672dde
commit
d0a02c2f61
@ -1,16 +1,13 @@
|
|||||||
use std::fs::File;
|
|
||||||
|
|
||||||
use async_graphql::{
|
use async_graphql::{
|
||||||
connection::{self, Connection, Edge},
|
connection::{Connection},
|
||||||
Context, EmptySubscription, Enum, Error, FieldResult, Object, Schema, SimpleObject, Union,
|
Context, EmptySubscription, Enum, Error, FieldResult, Object, Schema, SimpleObject, Union,
|
||||||
};
|
};
|
||||||
use log::{error, info, warn};
|
use log::info;
|
||||||
use mailparse::{parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
|
||||||
use memmap::MmapOptions;
|
|
||||||
use notmuch::Notmuch;
|
use notmuch::Notmuch;
|
||||||
use sqlx::postgres::PgPool;
|
use sqlx::postgres::PgPool;
|
||||||
|
|
||||||
use crate::{error::ServerError, linkify_html, newsreader, nm, sanitize_html};
|
use crate::{newsreader, nm};
|
||||||
|
|
||||||
/// # Number of seconds since the Epoch
|
/// # Number of seconds since the Epoch
|
||||||
pub type UnixTime = isize;
|
pub type UnixTime = isize;
|
||||||
|
|||||||
@ -50,7 +50,8 @@ pub async fn search(
|
|||||||
first,
|
first,
|
||||||
last,
|
last,
|
||||||
|after, before, first, last| async move {
|
|after, before, first, last| async move {
|
||||||
let rows = sqlx::query_file!("sql/threads.sql", site, query.unread_only)
|
info!("search page info {after:#?}, {before:#?}, {first:#?}, {last:#?}");
|
||||||
|
let rows = sqlx::query_file!("sql/threads.sql", site, query.unread_only,)
|
||||||
.fetch_all(pool)
|
.fetch_all(pool)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@ -91,10 +92,7 @@ pub async fn search(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn tags(pool: &PgPool, needs_unread: bool) -> Result<Vec<Tag>, ServerError> {
|
pub async fn tags(pool: &PgPool, needs_unread: bool) -> Result<Vec<Tag>, ServerError> {
|
||||||
// TODO: write separate query for needs_unread.
|
let tags = sqlx::query_file!("sql/tags.sql").fetch_all(pool).await?;
|
||||||
let tags = sqlx::query_file!("sql/tags.sql", needs_unread)
|
|
||||||
.fetch_all(pool)
|
|
||||||
.await?;
|
|
||||||
let tags = tags
|
let tags = tags
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|tag| {
|
.map(|tag| {
|
||||||
|
|||||||
@ -5,10 +5,7 @@ use std::{
|
|||||||
time::Instant,
|
time::Instant,
|
||||||
};
|
};
|
||||||
|
|
||||||
use async_graphql::{
|
use async_graphql::connection::{self, Connection, Edge};
|
||||||
connection::{self, Connection, Edge},
|
|
||||||
Context, EmptySubscription, Enum, FieldResult, Object, Schema, SimpleObject, Union,
|
|
||||||
};
|
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use mailparse::{parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
use mailparse::{parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||||
use memmap::MmapOptions;
|
use memmap::MmapOptions;
|
||||||
@ -20,7 +17,7 @@ use crate::{
|
|||||||
Attachment, Body, DispositionType, Email, Header, Html, Message, PlainText, Tag, Thread,
|
Attachment, Body, DispositionType, Email, Header, Html, Message, PlainText, Tag, Thread,
|
||||||
ThreadSummary, UnhandledContentType,
|
ThreadSummary, UnhandledContentType,
|
||||||
},
|
},
|
||||||
linkify_html, newsreader, nm, sanitize_html,
|
linkify_html, sanitize_html,
|
||||||
};
|
};
|
||||||
|
|
||||||
const TEXT_PLAIN: &'static str = "text/plain";
|
const TEXT_PLAIN: &'static str = "text/plain";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user