summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Gabriel Konat <gabrielkonat@gmail.com>2019-12-03 20:49:57 +0100
committerLibravatar Gabriel Konat <gabrielkonat@gmail.com>2019-12-04 14:39:20 +0100
commit5a974fe72d9bbf49dc7cdb9a114a6bb2e796469b (patch)
tree529019efc34c72a93a0787635bf299dec7742812
parentd1eb187e2673150b6c3f9fed0c15a1804ce0d75b (diff)
downloadiced-5a974fe72d9bbf49dc7cdb9a114a6bb2e796469b.tar.gz
iced-5a974fe72d9bbf49dc7cdb9a114a6bb2e796469b.tar.bz2
iced-5a974fe72d9bbf49dc7cdb9a114a6bb2e796469b.zip
Use cfg and path attribute instead of cfg_attr for IntelliJ Rust support
-rw-r--r--src/lib.rs7
-rw-r--r--winit/src/lib.rs7
-rw-r--r--winit/src/settings/mod.rs7
3 files changed, 15 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dd828afd..1ef11378 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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;
diff --git a/winit/src/lib.rs b/winit/src/lib.rs
index 00d200f9..df3a6997 100644
--- a/winit/src/lib.rs
+++ b/winit/src/lib.rs
@@ -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;
diff --git a/winit/src/settings/mod.rs b/winit/src/settings/mod.rs
index 151d73d7..58e3d879 100644
--- a/winit/src/settings/mod.rs
+++ b/winit/src/settings/mod.rs
@@ -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;