Use cfg and path attribute instead of cfg_attr for IntelliJ Rust support

This commit is contained in:
Gabriel Konat 2019-12-03 20:49:57 +01:00
parent d1eb187e26
commit 5a974fe72d
3 changed files with 15 additions and 6 deletions

View file

@ -180,8 +180,11 @@
#![deny(unsafe_code)]
#![deny(rust_2018_idioms)]
mod application;
#[cfg_attr(target_arch = "wasm32", path = "web.rs")]
#[cfg_attr(not(target_arch = "wasm32"), path = "native.rs")]
#[cfg(target_arch = "wasm32")]
#[path = "web.rs"]
mod platform;
#[cfg(not(target_arch = "wasm32"))]
#[path = "native.rs"]
mod platform;
mod sandbox;

View file

@ -35,8 +35,11 @@ pub use settings::Settings;
// We disable debug capabilities on release builds unless the `debug` feature
// is explicitly enabled.
#[cfg_attr(feature = "debug", path = "debug/basic.rs")]
#[cfg_attr(not(feature = "debug"), path = "debug/null.rs")]
#[cfg(feature = "debug")]
#[path = "debug/basic.rs"]
mod debug;
#[cfg(not(feature = "debug"))]
#[path = "debug/null.rs"]
mod debug;
use debug::Debug;

View file

@ -1,7 +1,10 @@
//! Configure your application.
#[cfg_attr(target_os = "windows", path = "windows.rs")]
#[cfg_attr(not(target_os = "windows"), path = "not_windows.rs")]
#[cfg(target_os = "windows")]
#[path = "windows.rs"]
mod platform;
#[cfg(not(target_os = "windows"))]
#[path = "not_windows.rs"]
mod platform;
pub use platform::PlatformSpecific;