Skip to content

Commit 0c7b657

Browse files
style: fix lint warnings
1 parent 5041b2a commit 0c7b657

20 files changed

Lines changed: 51 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,20 @@ jobs:
5050
include:
5151
- target: x86_64-unknown-linux-gnu # Debian
5252
os: ubuntu-latest
53+
container: ''
5354
shell: bash
55+
cargo_env: ''
5456
# TODO: Fix compiling for musl
5557
# - target: x86_64-unknown-linux-musl # Alpine
5658
# os: ubuntu-latest
5759
# container: alpine:latest
5860
# shell: sh
59-
# cargo_env: "source $HOME/.cargo/env"
61+
# cargo_env: "source $HOME/.cargo/env"
6062
- target: aarch64-unknown-linux-gnu # Debian
6163
os: ubuntu-24.04-arm
64+
container: ''
6265
shell: bash
66+
cargo_env: ''
6367
# TODO: Fix cross compiling for the below targets
6468
# - target: aarch64-unknown-linux-musl # Alpine
6569
# os: ubuntu-24.04-arm
@@ -84,13 +88,19 @@ jobs:
8488
# cargo_env: "source $HOME/.cargo/env"
8589
- target: x86_64-apple-darwin # macOS/Intel
8690
os: macos-latest
91+
container: ''
8792
shell: bash
93+
cargo_env: ''
8894
- target: aarch64-apple-darwin # macOS/Apple Silicon
8995
os: macos-latest
96+
container: ''
9097
shell: bash
98+
cargo_env: ''
9199
- target: x86_64-pc-windows-msvc # Windows
92100
os: windows-latest
101+
container: ''
93102
shell: bash
103+
cargo_env: ''
94104
name: Build (${{ matrix.target }})
95105
needs: setup_release
96106
runs-on: ${{ matrix.os }}

.rustfmt.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
array_width = 30
22
color = "Always"
3+
comment_width = 120
34
error_on_line_overflow = true
45
error_on_unformatted = true
56
fn_params_layout = "Vertical"
@@ -11,5 +12,5 @@ normalize_doc_attributes = true
1112
reorder_impl_items = true
1213
single_line_if_else_max_width = 100
1314
single_line_let_else_max_width = 100
14-
style_edition = "2021"
15+
style_edition = "2024"
1516
wrap_comments = true

crates/server/src/auth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#![doc = "Authentication utilities for the application."]
1+
//! Authentication utilities for the application.
22
33
// lib imports
4-
use base64::{engine::general_purpose, Engine as _};
5-
use bcrypt::{hash, verify, DEFAULT_COST};
4+
use base64::{Engine as _, engine::general_purpose};
5+
use bcrypt::{DEFAULT_COST, hash, verify};
66
use diesel::{QueryDsl, RunQueryDsl};
7-
use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation};
7+
use jsonwebtoken::{DecodingKey, EncodingKey, Header, Validation, decode, encode};
88
use once_cell::sync::Lazy;
99
use rand::Rng;
1010
use rocket::http::Status;

crates/server/src/certs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#![doc = "Certificate utilities for the application."]
1+
//! Certificate utilities for the application.
22
33
// standard imports
44
use std::fs;
55
use std::path::Path;
66

77
// lib imports
8-
use rcgen::{generate_simple_self_signed, CertifiedKey};
8+
use rcgen::{CertifiedKey, generate_simple_self_signed};
99

1010
/// Ensure that the certificates exist at the given paths.
1111
pub fn ensure_certificates_exist(

crates/server/src/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = "Configuration module for the application."]
1+
//! Configuration module for the application.
22
33
// lib imports
44
use config::{Config, ConfigError, Environment, File};
@@ -81,7 +81,8 @@ impl Default for ServerSettings {
8181
impl Settings {
8282
/// Create a new instance of `Settings`.
8383
pub fn new() -> Result<Self, ConfigError> {
84-
// Start with defaults provided via set_default and then merge in any provided config file or environment variables.
84+
// Start with defaults provided via set_default and then merge in any provided config file
85+
// or environment variables.
8586
let config = Config::builder()
8687
.set_default("general.data_dir", GeneralSettings::default().data_dir)?
8788
.set_default("server.use_https", ServerSettings::default().use_https)?

crates/server/src/db/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#![doc = "Database utilities for the application."]
1+
//! Database utilities for the application.
22
33
pub(crate) mod models;
44
pub(crate) mod schema;
55

66
// lib imports
7-
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
7+
use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations};
88
use rocket::{
9+
Build,
10+
Rocket,
911
fairing::{Fairing, Info, Kind},
10-
Build, Rocket,
1112
};
1213
use rocket_sync_db_pools::{database, diesel};
1314

crates/server/src/db/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = "Database models for the application."]
1+
//! Database models for the application.
22
33
// lib imports
44
use diesel::prelude::*;

crates/server/src/db/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = "Database schema for the application."]
1+
//! Database schema for the application.
22
33
// lib imports
44
use diesel::table;

crates/server/src/dependencies/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = "Module for everything related to dependencies."]
1+
//! Module for everything related to dependencies.
22
33
use cargo_metadata::{MetadataCommand, Package};
44
use std::error::Error;

crates/server/src/globals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = "Miscellaneous utilities for the application."]
1+
//! Miscellaneous utilities for the application.
22
33
// lib imports
44
use once_cell::sync::Lazy;

0 commit comments

Comments
 (0)