From 5d429fd5ae88dcf0fdcd60671b0271e21efbced6 Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Mon, 25 May 2020 21:55:49 +0200 Subject: [PATCH] Fix format and setup platform specific dependencies --- Cargo.toml | 7 +++---- examples/windows_demo.rs | 42 ++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82e599f..d1e864b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,12 @@ [package] name = "baseview" version = "0.1.0" -authors = ["William Light "] +authors = ["William Light ", "Mirko Covizzi "] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -winapi = { version = "0.3.8", features = ["libloaderapi", "winuser", "windef", "minwindef"] } -[[example]] -name = "windows_demo" \ No newline at end of file +[target.'cfg(windows)'.dependencies] +winapi = { version = "0.3.8", features = ["libloaderapi", "winuser", "windef", "minwindef"] } diff --git a/examples/windows_demo.rs b/examples/windows_demo.rs index 7c57ca5..9d32316 100644 --- a/examples/windows_demo.rs +++ b/examples/windows_demo.rs @@ -1,21 +1,21 @@ -use std::ptr::null_mut; - -use baseview::{WindowOpenOptions, create_window, handle_msg}; -use baseview::Parent; - -fn main() { - let window = WindowOpenOptions { - title: "Baseview", - width: 800, - height: 400, - parent: Parent::None - }; - - create_window(window); - - loop { - if !handle_msg(null_mut()) { - break; - } - } -} \ No newline at end of file +use std::ptr::null_mut; + +use baseview::Parent; +use baseview::{create_window, handle_msg, WindowOpenOptions}; + +fn main() { + let window = WindowOpenOptions { + title: "Baseview", + width: 800, + height: 400, + parent: Parent::None, + }; + + create_window(window); + + loop { + if !handle_msg(null_mut()) { + break; + } + } +}