style: apply rustfmt across all crates and demos
Consistent formatting pass: line wrapping, import sorting, trailing whitespace removal, let-chain indentation, merged derive attributes, and unsafe block reformatting. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -445,7 +445,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Classify device class based on comprehensive profiling
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn classify_device_class(capabilities: &EdgeCapabilities) -> EdgeClass {
|
||||
let compute_score = capabilities.compute_units as f32;
|
||||
let memory_score = (capabilities.memory_mb as f32 / 1024.0).min(16.0); // Cap at 16GB for scoring
|
||||
@@ -602,7 +602,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Detect available compute units (CPU cores, GPU units)
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn detect_compute_units() -> u32 {
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
@@ -617,7 +617,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Detect available system memory in megabytes
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn detect_memory_mb() -> u64 {
|
||||
#[cfg(all(feature = "std", target_os = "linux"))]
|
||||
{
|
||||
@@ -648,7 +648,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Detect SIMD instruction set support
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn detect_simd_support() -> SIMDClass {
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
return SIMDClass::NEON;
|
||||
@@ -672,7 +672,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Detect power budget classification
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn detect_power_budget() -> PowerClass {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return PowerClass::StandardBattery;
|
||||
@@ -697,7 +697,7 @@ impl EdgeCapabilityDetector {
|
||||
}
|
||||
|
||||
/// Detect network connectivity class
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn detect_network_class() -> NetworkClass {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
return NetworkClass::WiFi; // Browser typically WiFi
|
||||
|
||||
Reference in New Issue
Block a user