server: fix clippy warning

The clippy::uninlined_format_args warning in 1.67 was downgraded to
pedantic in 1.67.1 due to lack of support in rust-analyzer, so we're not
updating that one yet.
This commit is contained in:
Valentin Tolmer 2023-02-10 11:37:36 +01:00 committed by nitnelave
parent 8f2c5b397c
commit 96eb17a963
4 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#![recursion_limit = "256"] #![recursion_limit = "256"]
#![forbid(non_ascii_idents)] #![forbid(non_ascii_idents)]
#![allow(clippy::nonstandard_macro_braces)] #![allow(clippy::uninlined_format_args)]
pub mod components; pub mod components;
pub mod infra; pub mod infra;

View File

@ -1,3 +1,5 @@
#![allow(clippy::uninlined_format_args)]
use std::collections::HashSet; use std::collections::HashSet;
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};

View File

@ -336,15 +336,14 @@ pub async fn migrate_from_version(
pool: &DbConnection, pool: &DbConnection,
version: SchemaVersion, version: SchemaVersion,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
if version > LAST_SCHEMA_VERSION { match version.cmp(&LAST_SCHEMA_VERSION) {
anyhow::bail!("DB version downgrading is not supported"); std::cmp::Ordering::Less => info!(
} else if version == LAST_SCHEMA_VERSION {
return Ok(());
}
info!(
"Upgrading DB schema from {} to {}", "Upgrading DB schema from {} to {}",
version.0, LAST_SCHEMA_VERSION.0 version.0, LAST_SCHEMA_VERSION.0
); ),
std::cmp::Ordering::Equal => return Ok(()),
std::cmp::Ordering::Greater => anyhow::bail!("DB version downgrading is not supported"),
}
let builder = pool.get_database_backend(); let builder = pool.get_database_backend();
if version < SchemaVersion(2) { if version < SchemaVersion(2) {
// Drop the not_null constraint on display_name. Due to Sqlite, this is more complicated: // Drop the not_null constraint on display_name. Due to Sqlite, this is more complicated:

View File

@ -1,6 +1,7 @@
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
#![forbid(non_ascii_idents)] #![forbid(non_ascii_idents)]
#![allow(clippy::nonstandard_macro_braces)] // TODO: Remove next line once ubuntu upgrades rustc to >=1.67.1
#![allow(clippy::uninlined_format_args)]
use std::time::Duration; use std::time::Duration;