fix(theme): 消除 detect_initial_theme 的 unreachable_code 警告
wasm 分支末尾的 return Theme::System 在 wasm target 下让尾部兜底 Theme::System 不可达(unreachable_code 警告)。把尾部兜底用 #[cfg(not(target_arch = "wasm32"))] 限定,使其只在 server 分支 (cookie 未命中)或边角构建时编译,wasm target 下函数以 wasm 分支的 return 自然结束,两端都零警告。
This commit is contained in:
parent
2b6b2ca9e4
commit
ba5b146dfa
@ -140,6 +140,9 @@ fn detect_initial_theme() -> Theme {
|
||||
}
|
||||
}
|
||||
|
||||
// wasm 分支末尾已无条件 return Theme::System,不会到达这里;
|
||||
// 此兜底仅服务 server 分支(cookie 未命中)或其他边角构建。
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Theme::System
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user