Correct definitions of is_browser and is_server

This commit is contained in:
Greg Johnston 2022-12-14 06:57:35 -05:00
parent a7a35857bb
commit 21178b1682

View file

@ -612,7 +612,7 @@ pub fn document() -> web_sys::Document {
/// };
/// ```
pub const fn is_server() -> bool {
cfg!(all(target_arch = "wasm32", feature = "web"))
!is_browser()
}
/// Returns true if running on the browser (CSR).
@ -626,7 +626,7 @@ pub const fn is_server() -> bool {
/// };
/// ```
pub const fn is_browser() -> bool {
!is_server()
cfg!(all(target_arch = "wasm32", feature = "web"))
}
/// Returns true if `debug_assertions` are enabled.