anvilsign in

collin/anvil · b056637e

style: apply nightly rustfmt import grouping

Collin Richards · 2026-06-10 08:12 UTC · b056637e21e56c9da7054fad8493e0a5e58111e1 · parent 0c9a5673 · browse files

modifiedcrates/anvil-ci/src/lib.rs+21 −5
⋯ 13 unchanged lines
1414 //! pids/memory/cpu caps plus a wall-clock timeout and an optional image
1515 //! allowlist ([`anvil_core::config::CiConfig`]).
1616
17-use anvil_core::ci::{self, Pipeline};
17+use anvil_core::ci::{
18+ self,
19+ Pipeline,
20+};
1821 use anvil_core::config::CiConfig;
19-use anvil_core::{App, repos, storage, users};
20-use anvil_git::browse::{self, TreeFile};
22+use anvil_core::{
23+ App,
24+ repos,
25+ storage,
26+ users,
27+};
28+use anvil_git::browse::{
29+ self,
30+ TreeFile,
31+};
2132 use bollard::Docker;
2233 use bollard::container::{
23- Config, CreateContainerOptions, LogsOptions, RemoveContainerOptions, StartContainerOptions,
24- UploadToContainerOptions, WaitContainerOptions,
34+ Config,
35+ CreateContainerOptions,
36+ LogsOptions,
37+ RemoveContainerOptions,
38+ StartContainerOptions,
39+ UploadToContainerOptions,
40+ WaitContainerOptions,
2541 };
2642 use bollard::image::CreateImageOptions;
2743 use bollard::models::HostConfig;
⋯ 300 unchanged lines
modifiedcrates/anvil-core/src/access.rs+4 −1
⋯ 3 unchanged lines
44 //! a repo is owned by one user; private repos are visible only to their owner;
55 //! writes (push) and settings changes are owner-only. Admins may do anything.
66
7-use crate::models::{Repository, User};
7+use crate::models::{
8+ Repository,
9+ User,
10+};
811
912 /// Whether `viewer` may read (browse / clone) `repo`.
1013 pub fn can_read(repo: &Repository, viewer: Option<&User>) -> bool {
⋯ 10 unchanged lines
modifiedcrates/anvil-core/src/ci.rs+4 −1
⋯ 2 unchanged lines
33
44 use serde::Deserialize;
55
6-use crate::error::{Error, Result};
6+use crate::error::{
7+ Error,
8+ Result,
9+};
710 use crate::models::CiRun;
811
912 /// Run status values stored in [`CiRun::status`].
⋯ 230 unchanged lines
modifiedcrates/anvil-core/src/config.rs+12 −3
11 //! Server configuration: loaded from a TOML file with sensible defaults.
22
3-use std::path::{Path, PathBuf};
3+use std::path::{
4+ Path,
5+ PathBuf,
6+};
47
5-use serde::{Deserialize, Serialize};
8+use serde::{
9+ Deserialize,
10+ Serialize,
11+};
612
7-use crate::error::{Error, Result};
13+use crate::error::{
14+ Error,
15+ Result,
16+};
817
918 /// Top-level anvil configuration.
1019 ///
⋯ 260 unchanged lines
modifiedcrates/anvil-core/src/db.rs+7 −1
⋯ 2 unchanged lines
33 use std::path::Path;
44
55 use crate::error::Result;
6-use crate::models::{CiRun, Repository, Session, SshKey, User};
6+use crate::models::{
7+ CiRun,
8+ Repository,
9+ Session,
10+ SshKey,
11+ User,
12+};
713
814 /// Open (creating if necessary) the SQLite database at `path`, creating the
915 /// schema on first run.
⋯ 22 unchanged lines
modifiedcrates/anvil-core/src/lib.rs+19 −4
⋯ 17 unchanged lines
1818 pub mod users;
1919
2020 pub use config::Config;
21-pub use error::{Error, Result};
22-pub use models::{CiRun, Repository, Session, SshKey, User};
21+pub use error::{
22+ Error,
23+ Result,
24+};
25+pub use models::{
26+ CiRun,
27+ Repository,
28+ Session,
29+ SshKey,
30+ User,
31+};
2332
2433 /// Current Unix time in seconds, for `created_at` columns.
2534 pub(crate) fn now() -> i64 {
⋯ 48 unchanged lines
7483 /// session)`, hex-encoded. Stable for a session's lifetime, unguessable
7584 /// without the server secret, and requires no extra storage.
7685 pub fn csrf_token(&self, session_token: &str) -> String {
77- use hmac::{Hmac, Mac};
86+ use hmac::{
87+ Hmac,
88+ Mac,
89+ };
7890 let mut mac = Hmac::<sha2::Sha256>::new_from_slice(self.csrf_secret.as_slice())
7991 .expect("HMAC accepts any key length");
8092 mac.update(session_token.as_bytes());
⋯ 7 unchanged lines
88100
89101 /// Load the persistent CSRF secret, generating and saving it on first run.
90102 fn load_or_create_csrf_secret(data_dir: &std::path::Path) -> Result<[u8; 32]> {
91- use argon2::password_hash::rand_core::{OsRng, RngCore};
103+ use argon2::password_hash::rand_core::{
104+ OsRng,
105+ RngCore,
106+ };
92107
93108 let path = data_dir.join("csrf_secret");
94109 if path.exists() {
⋯ 16 unchanged lines
modifiedcrates/anvil-core/src/repos.rs+8 −2
⋯ 1 unchanged line
22
33 use std::path::Path;
44
5-use crate::error::{Error, Result};
6-use crate::models::{Repository, User};
5+use crate::error::{
6+ Error,
7+ Result,
8+};
9+use crate::models::{
10+ Repository,
11+ User,
12+};
713 use crate::storage;
814
915 /// A repository joined with its owner's username, for listing pages.
⋯ 141 unchanged lines
modifiedcrates/anvil-core/src/sessions.rs+8 −2
11 //! Web login sessions: opaque random tokens stored server-side and referenced
22 //! by a cookie.
33
4-use argon2::password_hash::rand_core::{OsRng, RngCore};
4+use argon2::password_hash::rand_core::{
5+ OsRng,
6+ RngCore,
7+};
58
69 use crate::error::Result;
7-use crate::models::{Session, User};
10+use crate::models::{
11+ Session,
12+ User,
13+};
814
915 /// Default session lifetime: 30 days.
1016 const SESSION_TTL_SECS: i64 = 60 * 60 * 24 * 30;
⋯ 63 unchanged lines
modifiedcrates/anvil-core/src/ssh_keys.rs+8 −2
11 //! SSH public keys: parsing, registration, and lookup for git-over-SSH
22 //! authentication.
33
4-use ssh_key::{HashAlg, PublicKey};
4+use ssh_key::{
5+ HashAlg,
6+ PublicKey,
7+};
58
6-use crate::error::{Error, Result};
9+use crate::error::{
10+ Error,
11+ Result,
12+};
713 use crate::models::SshKey;
814
915 /// Parse an OpenSSH public-key line (`ssh-ed25519 AAAA… comment`) into its
⋯ 83 unchanged lines
modifiedcrates/anvil-core/src/storage.rs+14 −3
⋯ 4 unchanged lines
55 //! between forge identities and filesystem paths, plus creation/opening via
66 //! `gix`. No database access happens here.
77
8-use std::path::{Path, PathBuf};
8+use std::path::{
9+ Path,
10+ PathBuf,
11+};
912
10-use crate::error::{Error, Result};
13+use crate::error::{
14+ Error,
15+ Result,
16+};
1117
1218 /// Compute the on-disk path of a bare repository.
1319 pub fn repo_path(repositories_dir: &Path, owner: &str, name: &str) -> PathBuf {
⋯ 33 unchanged lines
4753 /// Point `HEAD` at `refs/heads/<branch>` as a symbolic reference.
4854 fn set_head_branch(repo: &gix::Repository, branch: &str) -> Result<()> {
4955 use gix::refs::Target;
50- use gix::refs::transaction::{Change, LogChange, PreviousValue, RefEdit};
56+ use gix::refs::transaction::{
57+ Change,
58+ LogChange,
59+ PreviousValue,
60+ RefEdit,
61+ };
5162
5263 let target_name: gix::refs::FullName = format!("refs/heads/{branch}")
5364 .try_into()
⋯ 23 unchanged lines
modifiedcrates/anvil-core/src/users.rs+10 −2
⋯ 1 unchanged line
22
33 use argon2::Argon2;
44 use argon2::password_hash::rand_core::OsRng;
5-use argon2::password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString};
5+use argon2::password_hash::{
6+ PasswordHash,
7+ PasswordHasher,
8+ PasswordVerifier,
9+ SaltString,
10+};
611
7-use crate::error::{Error, Result};
12+use crate::error::{
13+ Error,
14+ Result,
15+};
816 use crate::models::User;
917
1018 /// Usernames reserved for system use — they collide with (or could be confused
⋯ 94 unchanged lines
modifiedcrates/anvil-git/src/browse.rs+8 −2
⋯ 2 unchanged lines
33 //! These helpers back the web UI. Each opens the bare repo by path; that is
44 //! cheap enough at our scale and keeps the API stateless.
55
6-use std::collections::{BTreeMap, BTreeSet};
6+use std::collections::{
7+ BTreeMap,
8+ BTreeSet,
9+};
710 use std::fmt::Display;
811 use std::path::Path;
912
10-use crate::error::{Error, Result};
13+use crate::error::{
14+ Error,
15+ Result,
16+};
1117
1218 /// Summary of a repository's refs and state, for the repo landing page.
1319 pub struct Overview {
⋯ 485 unchanged lines
modifiedcrates/anvil-git/src/lib.rs+8 −2
⋯ 18 unchanged lines
1919 pub mod ssh;
2020 pub mod trigger;
2121
22-pub use error::{Error, Result};
23-pub use smart_http::{Service, UploadPack};
22+pub use error::{
23+ Error,
24+ Result,
25+};
26+pub use smart_http::{
27+ Service,
28+ UploadPack,
29+};
modifiedcrates/anvil-git/src/smart_http.rs+5 −1
⋯ 13 unchanged lines
1414 use std::pin::Pin;
1515
1616 use gitserver_core::backend::GitBackend;
17-use gitserver_core::{pack, pktline, protocol_v2};
17+use gitserver_core::{
18+ pack,
19+ pktline,
20+ protocol_v2,
21+};
1822 use tokio::io::AsyncRead;
1923
2024 use crate::error::Result;
⋯ 131 unchanged lines
modifiedcrates/anvil-git/src/ssh.rs+11 −2
⋯ 11 unchanged lines
1212 use std::path::Path;
1313
1414 use gitserver_core::backend::GitBackend;
15-use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
15+use tokio::io::{
16+ AsyncRead,
17+ AsyncReadExt,
18+ AsyncWrite,
19+ AsyncWriteExt,
20+};
1621
1722 use crate::error::Result;
18-use crate::smart_http::{self, Service, UploadPack};
23+use crate::smart_http::{
24+ self,
25+ Service,
26+ UploadPack,
27+};
1928
2029 /// Parse an SSH `exec` command such as `git-upload-pack '/alice/hello.git'`,
2130 /// returning the service and the (leading-slash-trimmed) repository path.
⋯ 198 unchanged lines
modifiedcrates/anvil-ssh/src/lib.rs+33 −6
⋯ 6 unchanged lines
77 //! The SSH bind address is configurable (`[ssh] listen` in the config).
88
99 use std::net::SocketAddr;
10-use std::path::{Path, PathBuf};
10+use std::path::{
11+ Path,
12+ PathBuf,
13+};
1114 use std::sync::Arc;
1215 use std::time::Duration;
1316
14-use anvil_core::{App, Error as CoreError, Result as CoreResult, access, repos, users};
17+use anvil_core::{
18+ App,
19+ Error as CoreError,
20+ Result as CoreResult,
21+ access,
22+ repos,
23+ users,
24+};
1525 use anvil_git::ssh as git_ssh;
16-use russh::keys::ssh_key::{HashAlg, LineEnding, PublicKey};
17-use russh::keys::{Algorithm, PrivateKey};
18-use russh::server::{self, Auth, Handler, Msg, Server as _, Session};
19-use russh::{Channel, ChannelId};
26+use russh::keys::ssh_key::{
27+ HashAlg,
28+ LineEnding,
29+ PublicKey,
30+};
31+use russh::keys::{
32+ Algorithm,
33+ PrivateKey,
34+};
35+use russh::server::{
36+ self,
37+ Auth,
38+ Handler,
39+ Msg,
40+ Server as _,
41+ Session,
42+};
43+use russh::{
44+ Channel,
45+ ChannelId,
46+};
2047 use tokio::net::TcpListener;
2148
2249 /// Bind to the configured SSH address and serve git over SSH until shutdown.
⋯ 244 unchanged lines
modifiedcrates/anvil-web/src/auth.rs+29 −6
⋯ 2 unchanged lines
33
44 use std::convert::Infallible;
55
6-use anvil_core::{App, User, sessions, users};
6+use anvil_core::{
7+ App,
8+ User,
9+ sessions,
10+ users,
11+};
712 use axum::{
813 Form,
9- extract::{FromRequestParts, Request, State},
10- http::{StatusCode, request::Parts},
14+ extract::{
15+ FromRequestParts,
16+ Request,
17+ State,
18+ },
19+ http::{
20+ StatusCode,
21+ request::Parts,
22+ },
1123 middleware::Next,
12- response::{IntoResponse, Redirect, Response},
24+ response::{
25+ IntoResponse,
26+ Redirect,
27+ Response,
28+ },
1329 };
14-use axum_extra::extract::cookie::{Cookie, CookieJar, SameSite};
15-use maud::{Markup, html};
30+use axum_extra::extract::cookie::{
31+ Cookie,
32+ CookieJar,
33+ SameSite,
34+};
35+use maud::{
36+ Markup,
37+ html,
38+};
1639
1740 use crate::ui::layout;
1841
⋯ 202 unchanged lines
modifiedcrates/anvil-web/src/git_http.rs+34 −7
⋯ 10 unchanged lines
1111 use std::collections::HashMap;
1212 use std::path::PathBuf;
1313
14-use anvil_core::{App, Repository, access, repos, users};
15-use anvil_git::smart_http::{self, Service, UploadPack};
14+use anvil_core::{
15+ App,
16+ Repository,
17+ access,
18+ repos,
19+ users,
20+};
21+use anvil_git::smart_http::{
22+ self,
23+ Service,
24+ UploadPack,
25+};
1626 use axum::{
1727 Router,
18- body::{Body, Bytes},
19- extract::{Path, Query, State},
20- http::{HeaderMap, StatusCode, header},
21- response::{IntoResponse, Response},
22- routing::{get, post},
28+ body::{
29+ Body,
30+ Bytes,
31+ },
32+ extract::{
33+ Path,
34+ Query,
35+ State,
36+ },
37+ http::{
38+ HeaderMap,
39+ StatusCode,
40+ header,
41+ },
42+ response::{
43+ IntoResponse,
44+ Response,
45+ },
46+ routing::{
47+ get,
48+ post,
49+ },
2350 };
2451 use tokio_util::io::ReaderStream;
2552
⋯ 178 unchanged lines
modifiedcrates/anvil-web/src/lib.rs+8 −2
⋯ 7 unchanged lines
88 // pattern is intentional and the responses are never hot-path allocated en masse.
99 #![allow(clippy::result_large_err)]
1010
11-use anvil_core::{App, Result};
11+use anvil_core::{
12+ App,
13+ Result,
14+};
1215 use axum::{
1316 Router,
14- routing::{get, post},
17+ routing::{
18+ get,
19+ post,
20+ },
1521 };
1622
1723 pub mod auth;
⋯ 37 unchanged lines
modifiedcrates/anvil-web/src/pages.rs+19 −4
⋯ 15 unchanged lines
1616 use anvil_git::browse;
1717 use axum::{
1818 Router,
19- extract::{Path, State},
19+ extract::{
20+ Path,
21+ State,
22+ },
2023 http::header,
21- response::{IntoResponse, Redirect, Response},
24+ response::{
25+ IntoResponse,
26+ Redirect,
27+ Response,
28+ },
2229 routing::get,
2330 };
24-use maud::{Markup, html};
31+use maud::{
32+ Markup,
33+ html,
34+};
2535
2636 use crate::auth::CurrentUser;
27-use crate::ui::{layout, not_found, resolve_repo, server_error};
37+use crate::ui::{
38+ layout,
39+ not_found,
40+ resolve_repo,
41+ server_error,
42+};
2843
2944 /// The branch pages are served from.
3045 pub const PAGES_REF: &str = "pages";
⋯ 139 unchanged lines
modifiedcrates/anvil-web/src/ui.rs+77 −16
⋯ 1 unchanged line
22 //! blob viewing. Pages are plain SSR and work without JavaScript; htmx-based
33 //! progressive enhancement is a follow-up.
44
5-use std::collections::{BTreeMap, HashMap};
5+use std::collections::{
6+ BTreeMap,
7+ HashMap,
8+};
69 use std::path::PathBuf;
7-use std::sync::{Arc, Mutex, OnceLock};
10+use std::sync::{
11+ Arc,
12+ Mutex,
13+ OnceLock,
14+};
815
9-use anvil_core::{App, CiRun, Repository, SshKey, User, access, ci, repos, ssh_keys, users};
10-use anvil_git::browse::{self, ChangeKind, FileChange};
16+use anvil_core::{
17+ App,
18+ CiRun,
19+ Repository,
20+ SshKey,
21+ User,
22+ access,
23+ ci,
24+ repos,
25+ ssh_keys,
26+ users,
27+};
28+use anvil_git::browse::{
29+ self,
30+ ChangeKind,
31+ FileChange,
32+};
1133 use axum::{
12- Form, Router,
13- extract::{Path, Query, State},
14- http::{StatusCode, header},
15- response::{IntoResponse, Redirect, Response},
16- routing::{get, post},
34+ Form,
35+ Router,
36+ extract::{
37+ Path,
38+ Query,
39+ State,
40+ },
41+ http::{
42+ StatusCode,
43+ header,
44+ },
45+ response::{
46+ IntoResponse,
47+ Redirect,
48+ Response,
49+ },
50+ routing::{
51+ get,
52+ post,
53+ },
54+};
55+use maud::{
56+ DOCTYPE,
57+ Markup,
58+ PreEscaped,
59+ html,
60+};
61+use similar::{
62+ ChangeTag,
63+ TextDiff,
1764 };
18-use maud::{DOCTYPE, Markup, PreEscaped, html};
19-use similar::{ChangeTag, TextDiff};
2065 use syntect::easy::HighlightLines;
21-use syntect::highlighting::{Theme, ThemeSet};
22-use syntect::html::{IncludeBackground, styled_line_to_highlighted_html};
66+use syntect::highlighting::{
67+ Theme,
68+ ThemeSet,
69+};
70+use syntect::html::{
71+ IncludeBackground,
72+ styled_line_to_highlighted_html,
73+};
2374 use syntect::parsing::SyntaxSet;
2475 use time::OffsetDateTime;
2576
26-use crate::auth::{CSRF_FIELD, Csrf, CurrentUser, verify_csrf};
77+use crate::auth::{
78+ CSRF_FIELD,
79+ Csrf,
80+ CurrentUser,
81+ verify_csrf,
82+};
2783
2884 const STYLE: &str = r#"
2985 :root { --fg:#1f2328; --muted:#656d76; --bg:#fff; --border:#d0d7de; --accent:#0969da; --code-bg:#f6f8fa; }
⋯ 100 unchanged lines
130186
131187 /// Clipboard icon for the clone "copy" button.
132188 const CLIPBOARD_SVG: &str = r#"<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true"><path d="M10 1.5H6a.5.5 0 0 0-.5.5v1H4A1.5 1.5 0 0 0 2.5 4.5v9A1.5 1.5 0 0 0 4 15h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 12 3h-1.5V2a.5.5 0 0 0-.5-.5zm-3.5 1h3v1h-3v-1zM4 4.5h8v9H4v-9z"/></svg>"#;
133-
134189 /// Delegated handlers for the clone widget: protocol toggle + copy-to-clipboard.
135190 /// Registered once on `document`, so it survives htmx body swaps.
136191 const CLONE_JS: &str = r#"
⋯ 793 unchanged lines
930985 /// source is emitted as escaped literal text, and `javascript:`/`data:`-style
931986 /// link and image destinations are dropped.
932987 fn render_markdown(text: &str) -> Markup {
933- use pulldown_cmark::{Event, Options, Parser, Tag, html};
988+ use pulldown_cmark::{
989+ Event,
990+ Options,
991+ Parser,
992+ Tag,
993+ html,
994+ };
934995
935996 fn safe_url(dest: &str) -> bool {
936997 let d = dest.trim().to_ascii_lowercase();
⋯ 568 unchanged lines
modifiedcrates/anvil/src/main.rs+15 −3
11 //! `anvild` — the anvil git forge daemon and admin CLI.
22
3-use anvil_core::{App, Config, repos, ssh_keys, users};
4-use anyhow::{Context, Result};
5-use clap::{Parser, Subcommand};
3+use anvil_core::{
4+ App,
5+ Config,
6+ repos,
7+ ssh_keys,
8+ users,
9+};
10+use anyhow::{
11+ Context,
12+ Result,
13+};
14+use clap::{
15+ Parser,
16+ Subcommand,
17+};
618
719 #[derive(Parser)]
820 #[command(name = "anvild", version, about = "anvil git forge")]
⋯ 201 unchanged lines
modifiedvendor/gitserver-core/src/backend.rs+13 −3
11 use std::path::PathBuf;
22 use std::pin::Pin;
33 use std::sync::Arc;
4-use std::sync::atomic::{AtomicBool, Ordering};
5-use std::task::{Context, Poll};
4+use std::sync::atomic::{
5+ AtomicBool,
6+ Ordering,
7+};
8+use std::task::{
9+ Context,
10+ Poll,
11+};
612
713 use tokio::io::AsyncRead;
8-use tokio::time::{Duration, Sleep, sleep};
14+use tokio::time::{
15+ Duration,
16+ Sleep,
17+ sleep,
18+};
919 use tokio_util::io::SyncIoBridge;
1020
1121 use crate::error::Result;
⋯ 230 unchanged lines
modifiedvendor/gitserver-core/src/discovery.rs+13 −3
11 use std::fs;
2-use std::path::{Path, PathBuf};
2+use std::path::{
3+ Path,
4+ PathBuf,
5+};
36
47 use serde::Serialize;
58
6-pub use crate::dynamic_registry::{DynamicRepoRegistry, MutableRepoRegistry, RepoResolver};
7-use crate::error::{Error, Result};
9+pub use crate::dynamic_registry::{
10+ DynamicRepoRegistry,
11+ MutableRepoRegistry,
12+ RepoResolver,
13+};
14+use crate::error::{
15+ Error,
16+ Result,
17+};
818
919 const DEFAULT_GIT_DESCRIPTION: &str =
1020 "Unnamed repository; edit this file 'description' to name the repository.";
⋯ 285 unchanged lines
modifiedvendor/gitserver-core/src/dynamic_registry.rs+16 −4
⋯ 3 unchanged lines
44 //
55 // Copyright (c) 2026 WJQSERVER
66
7-use std::path::{Path, PathBuf};
8-use std::sync::{Arc, RwLock};
7+use std::path::{
8+ Path,
9+ PathBuf,
10+};
11+use std::sync::{
12+ Arc,
13+ RwLock,
14+};
915
10-use crate::discovery::{RepoInfo, RepoStore};
11-use crate::error::{Error, Result};
16+use crate::discovery::{
17+ RepoInfo,
18+ RepoStore,
19+};
20+use crate::error::{
21+ Error,
22+ Result,
23+};
1224
1325 pub trait RepoResolver: Send + Sync {
1426 fn resolve(&self, relative: &str) -> Result<RepoInfo>;
⋯ 249 unchanged lines
modifiedvendor/gitserver-core/src/pack.rs+12 −3
⋯ 1 unchanged line
22 use std::path::Path;
33
44 use bytes::Bytes;
5-use sha1::{Digest, Sha1};
5+use sha1::{
6+ Digest,
7+ Sha1,
8+};
69 use tokio::io::AsyncRead;
710 use tokio_util::io::StreamReader;
811
9-use crate::error::{Error, Result};
12+use crate::error::{
13+ Error,
14+ Result,
15+};
1016 use crate::pktline;
1117
1218 #[derive(Debug, Clone, Default)]
⋯ 637 unchanged lines
650656
651657 #[cfg(test)]
652658 mod tests {
653- use std::path::{Path, PathBuf};
659+ use std::path::{
660+ Path,
661+ PathBuf,
662+ };
654663 use std::process::Command;
655664
656665 use tempfile::TempDir;
⋯ 183 unchanged lines
modifiedvendor/gitserver-core/src/path.rs+9 −2
1-use std::path::{Component, Path, PathBuf};
1+use std::path::{
2+ Component,
3+ Path,
4+ PathBuf,
5+};
26
3-use crate::error::{Error, Result};
7+use crate::error::{
8+ Error,
9+ Result,
10+};
411
512 /// Normalize a path by resolving `.` and `..` components lexically,
613 /// without touching the filesystem.
⋯ 90 unchanged lines
modifiedvendor/gitserver-core/src/protocol_v2.rs+8 −2
⋯ 8 unchanged lines
99 use std::io::Cursor;
1010 use std::path::Path;
1111
12-use crate::error::{Error, Result};
12+use crate::error::{
13+ Error,
14+ Result,
15+};
1316 use crate::pack::UploadPackRequest;
1417 use crate::pktline;
1518
⋯ 566 unchanged lines
582585 request: &crate::pack::UploadPackRequest,
583586 depth: usize,
584587 ) -> Result<DepthState> {
585- use std::collections::{HashSet, VecDeque};
588+ use std::collections::{
589+ HashSet,
590+ VecDeque,
591+ };
586592
587593 let mut queue = VecDeque::new();
588594 let mut seen = HashSet::new();
⋯ 158 unchanged lines
modifiedvendor/gitserver-core/src/receive_pack.rs+16 −3
⋯ 3 unchanged lines
44 //
55 // Copyright (c) 2026 WJQSERVER
66
7-use std::io::{BufRead, BufReader, Read};
7+use std::io::{
8+ BufRead,
9+ BufReader,
10+ Read,
11+};
812 use std::path::Path;
913 use std::sync::atomic::AtomicBool;
1014
⋯ 1 unchanged line
1216 use gix::prelude::ObjectIdExt;
1317 use gix::progress::Discard;
1418 use gix::refs::Target;
15-use gix::refs::transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog};
19+use gix::refs::transaction::{
20+ Change,
21+ LogChange,
22+ PreviousValue,
23+ RefEdit,
24+ RefLog,
25+};
1626
17-use crate::error::{Error, Result};
27+use crate::error::{
28+ Error,
29+ Result,
30+};
1831 use crate::pktline;
1932
2033 const ZERO_ID: &str = "0000000000000000000000000000000000000000";
⋯ 642 unchanged lines
modifiedvendor/gitserver-core/src/refs.rs+4 −1
⋯ 73 unchanged lines
7474
7575 #[cfg(test)]
7676 mod tests {
77- use std::path::{Path, PathBuf};
77+ use std::path::{
78+ Path,
79+ PathBuf,
80+ };
7881 use std::process::Command;
7982
8083 use tempfile::TempDir;
⋯ 140 unchanged lines