Fix up
This commit is contained in:
parent
fc19e650ca
commit
0f441e38d8
24 changed files with 553 additions and 68 deletions
|
|
@ -124,5 +124,7 @@ impl ClientCursorsWithTimeToLive {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_expired(&self, ttl: Duration) -> bool { self.last_updated.elapsed() > ttl }
|
||||
pub fn is_expired(&self, ttl: Duration) -> bool {
|
||||
self.last_updated.elapsed() > ttl
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ pub struct StoredDocumentVersion {
|
|||
}
|
||||
|
||||
impl PartialEq<Self> for StoredDocumentVersion {
|
||||
fn eq(&self, other: &Self) -> bool { self.vault_update_id == other.vault_update_id }
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.vault_update_id == other.vault_update_id
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(TS, Debug, Clone, Serialize)]
|
||||
|
|
|
|||
|
|
@ -179,6 +179,10 @@ async fn shutdown_signal() {
|
|||
}
|
||||
}
|
||||
|
||||
async fn handle_404() -> impl IntoResponse { not_found_error(anyhow!("Page not found")) }
|
||||
async fn handle_404() -> impl IntoResponse {
|
||||
not_found_error(anyhow!("Page not found"))
|
||||
}
|
||||
|
||||
async fn handle_405() -> impl IntoResponse { client_error(anyhow!("Method not allowed")) }
|
||||
async fn handle_405() -> impl IntoResponse {
|
||||
client_error(anyhow!("Method not allowed"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ pub struct DeviceIdHeader(pub String);
|
|||
pub static DEVICE_ID_HEADER_NAME: HeaderName = HeaderName::from_static("device-id");
|
||||
|
||||
impl Header for DeviceIdHeader {
|
||||
fn name() -> &'static HeaderName { &DEVICE_ID_HEADER_NAME }
|
||||
fn name() -> &'static HeaderName {
|
||||
&DEVICE_ID_HEADER_NAME
|
||||
}
|
||||
|
||||
fn decode<'i, I>(values: &mut I) -> Result<Self, headers::Error>
|
||||
where
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ pub async fn update_document(
|
|||
&& is_binary(&content)
|
||||
{
|
||||
reconcile(
|
||||
&str::from_utf8(&parent_document.content)
|
||||
str::from_utf8(&parent_document.content)
|
||||
.expect("parent must be valid UTF-8 because it's not binary"),
|
||||
&str::from_utf8(&latest_version.content)
|
||||
.expect("latest_version must be valid UTF-8 because it's not binary")
|
||||
|
|
|
|||
|
|
@ -8,4 +8,6 @@ where
|
|||
Ok(normalize_string(&s))
|
||||
}
|
||||
|
||||
pub fn normalize_string(s: &str) -> String { s.trim().to_lowercase() }
|
||||
pub fn normalize_string(s: &str) -> String {
|
||||
s.trim().to_lowercase()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue