mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
+13
-6
@@ -31,7 +31,10 @@ where
|
||||
/// the query. The maximum size is supplied as const generic parameter.
|
||||
#[implement(super::Map)]
|
||||
#[inline]
|
||||
pub fn aqry<const MAX: usize, K>(self: &Arc<Self>, key: &K) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
pub fn aqry<const MAX: usize, K>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
{
|
||||
@@ -43,7 +46,11 @@ where
|
||||
/// asynchronously. The key is serialized into a user-supplied Writer.
|
||||
#[implement(super::Map)]
|
||||
#[tracing::instrument(skip(self, buf), level = "trace")]
|
||||
pub fn bqry<K, B>(self: &Arc<Self>, key: &K, buf: &mut B) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
pub fn bqry<K, B>(
|
||||
self: &Arc<Self>,
|
||||
key: &K,
|
||||
buf: &mut B,
|
||||
) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||
where
|
||||
K: Serialize + ?Sized + Debug,
|
||||
B: Write + AsRef<[u8]>,
|
||||
@@ -110,15 +117,15 @@ where
|
||||
|
||||
match res {
|
||||
// cache hit; not found
|
||||
Ok(None) => Err!(Request(NotFound("Not found in database"))),
|
||||
| Ok(None) => Err!(Request(NotFound("Not found in database"))),
|
||||
|
||||
// cache hit; value found
|
||||
Ok(Some(res)) => Ok(Some(Handle::from(res))),
|
||||
| Ok(Some(res)) => Ok(Some(Handle::from(res))),
|
||||
|
||||
// cache miss; unknown
|
||||
Err(e) if is_incomplete(&e) => Ok(None),
|
||||
| Err(e) if is_incomplete(&e) => Ok(None),
|
||||
|
||||
// some other error occurred
|
||||
Err(e) => or_else(e),
|
||||
| Err(e) => or_else(e),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user