Skip to content

Commit 7af8314

Browse files
style(Mountain): fix doc comments, reformat code, and reorganize imports
This commit applies multiple improvements across Mountain's codebase: 1. **Doc Comment Fixes:** Replace bracket-style references with backtick code spans for proper rustdoc rendering across Command, Environment, IPC, and Workspace modules. Fix Windows URL angle brackets in Scheme documentation. 2. **Code Formatting:** Apply rustfmt to multiple files for consistent style - DnsCommands, Scheme, ServiceRegistry, Entry, LanguageFeatureProvider, Library, and CocoonService. 3. **Import Reorganization (CocoonService):** Restructure protobuf imports in `Source/RPC/CocoonService.rs` to group by category (Service traits, Language, Window, FS, Output, Task, Auth, Debug, Extension types) with clear section comments, improving readability and maintainability. 4. **Cargo Feature:** Enable `trace` feature on opentelemetry dependency for enhanced observability. 5. **Submodule Update:** Update Documentation/Rust to d6fefa9. No functional changes - purely cosmetic and documentation improvements.
1 parent 4d0d3ce commit 7af8314

26 files changed

Lines changed: 158 additions & 206 deletions

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ ring = { workspace = true }
8383
bincode = { workspace = true }
8484
brotli = { workspace = true }
8585
hex = { workspace = true }
86-
opentelemetry = { workspace = true }
86+
opentelemetry = { workspace = true, features = ["trace"] }
8787

8888
[features]
8989
default = ["ExtensionHostCocoon", "MistNative", "AirIntegration"]

Documentation/Rust

Submodule Rust updated 2573 files

Source/Air/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
//! - Integration point with the Air background service (daemon)
1515
//! - Used by multiple Mountain components:
1616
//! - `UpdateService` for self-updates
17-
//! - [`SearchProvider`] for file search
18-
//! - [`SecretProvider`] for secret
19-
//! storage
17+
//! - `SearchProvider` for file search
18+
//! - `SecretProvider` for secret storage
2019
//! - Connection is optional; Mountain can function without Air (graceful
2120
//! degradation)
2221
//! - Service discovery and health checking via gRPC

Source/Binary/Build/DnsCommands.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,7 @@ mod tests {
782782

783783
#[test]
784784
fn test_forward_allowlist_serialization() {
785-
let allowlist = ForwardAllowList {
786-
domains:vec!["update.editor.land.".to_string()],
787-
};
785+
let allowlist = ForwardAllowList { domains:vec!["update.editor.land.".to_string()] };
788786

789787
let json = serde_json::to_string(&allowlist).unwrap();
790788
let deserialized:ForwardAllowList = serde_json::from_str(&json).unwrap();

Source/Binary/Build/Scheme.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pub fn init_service_registry(registry:ServiceRegistry) {
6767
/// 3. After initialization, we only read from it
6868
/// 4. The RwLock guarantees thread-safe access
6969
fn get_service_registry() -> Option<ServiceRegistry> {
70-
let guard = SERVICE_REGISTRY.read().ok()?;
71-
guard.clone()
70+
let guard = SERVICE_REGISTRY.read().ok()?;
71+
guard.clone()
7272
}
7373

7474
/// DNS port managed state structure
@@ -649,7 +649,7 @@ pub fn land_scheme_handler_async<R:tauri::Runtime>(
649649
///
650650
/// Tauri uses different origins for custom URI schemes on different platforms:
651651
/// - macOS, Linux: land://localhost/
652-
/// - Windows: http://land.localhost/
652+
/// - Windows: <http://land.localhost/>
653653
///
654654
/// Returns a comma-separated list of origins to support all platforms.
655655
fn get_cors_origins() -> &'static str {

Source/Binary/Build/ServiceRegistry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl LocalService {
8282
/// provisioning.
8383
#[derive(Clone)]
8484
pub struct ServiceRegistry {
85-
/// Inner storage using Arc<RwLock> for thread-safe concurrent access
85+
/// Inner storage using `Arc<RwLock>` for thread-safe concurrent access
8686
services:Arc<RwLock<HashMap<String, LocalService>>>,
8787
/// Optional certificate manager for HTTPS support
8888
cert_manager:Option<std::sync::Arc<std::sync::Mutex<super::CertificateManager::CertificateManager>>>,

Source/Binary/Main/Entry.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ pub fn Fn() {
237237
// that land:// protocol_resolution is available
238238
info!("[Lifecycle] [Setup] Starting DNS server on preferred port 5380...");
239239
let dns_port = mist::start(5380).unwrap_or_else(|e| {
240-
warn!("[Lifecycle] [Setup] Failed to start DNS server on port 5380: {}", e);
241-
// Fallback to random port if preferred port fails
242-
mist::start(0).unwrap_or_else(|e| {
243-
error!("[Lifecycle] [Setup] Completely failed to start DNS server: {}", e);
244-
0 // Return 0 as error indicator
245-
})
240+
warn!("[Lifecycle] [Setup] Failed to start DNS server on port 5380: {}", e);
241+
// Fallback to random port if preferred port fails
242+
mist::start(0).unwrap_or_else(|e| {
243+
error!("[Lifecycle] [Setup] Completely failed to start DNS server: {}", e);
244+
0 // Return 0 as error indicator
245+
})
246246
});
247247

248248
if dns_port == 0 {
@@ -278,9 +278,9 @@ pub fn Fn() {
278278
}
279279
})
280280
.register_asynchronous_uri_scheme_protocol("land", |_ctx, request, responder| {
281-
// Implemented: delegate to synchronous scheme handler
282-
let response = crate::Binary::Build::Scheme::land_scheme_handler(&request);
283-
responder.respond(response);
281+
// Implemented: delegate to synchronous scheme handler
282+
let response = crate::Binary::Build::Scheme::land_scheme_handler(&request);
283+
responder.respond(response);
284284
})
285285
.plugin(tauri_plugin_dialog::init())
286286
.plugin(tauri_plugin_fs::init())

Source/Command/LanguageFeature.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! ARCHITECTURAL ROLE:
1616
//! - Command layer that exposes language features via Tauri IPC (`#[command]`)
1717
//! - Delegates to Environment's
18-
//! [`LanguageFeatureProvider`]
18+
//! `LanguageFeatureProvider`
1919
//! via DI with `Require()` trait
2020
//! - Translates between frontend JSON parameters and Rust DTO types
2121
//! - Error strings returned directly to frontend for display

Source/Command/SourceControlManagement.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
//! `SourceControlManagementProvider` implementations in the Environment
1616
//! layer
1717
//! - Uses Tauri's `#[command]` attribute for IPC exposure
18-
//! - Reads from [`ApplicationState.SourceControlManagement*
19-
//! `] fields to gather state
18+
//! - Reads from `ApplicationState.SourceControlManagement*` fields to gather state
2019
//! - TODO: Should forward commands to provider methods via DI (Require trait)
2120
//!
2221
//! COMMAND REFERENCE (Tauri IPC):

Source/Command/TreeView.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! - Command module exposing TreeView functionality via Tauri IPC
1212
//! (`#[command]`)
1313
//! - Delegates to Environment's
14-
//! [`TreeViewProvider`] via DI with
14+
//! `TreeViewProvider` via DI with
1515
//! `Require()` trait from `MountainEnvironment`
1616
//! - Translates frontend requests to provider method calls with proper error
1717
//! mapping

0 commit comments

Comments
 (0)