Skip to content

Commit

Permalink
Running rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
not-avail committed Jun 25, 2018
1 parent 1d43ca4 commit c38a38e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use libremarkable::image::GenericImage;

use std::process::Command;

#[cfg(feature="enable-runtime-benchmarking")]
#[cfg(feature = "enable-runtime-benchmarking")]
use libremarkable::stopwatch;

fn loop_update_topbar(app: &mut appctx::ApplicationContext, millis: u64) {
Expand Down
3 changes: 1 addition & 2 deletions src/appctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use input::multitouch::MultitouchEvent;
use input::wacom::WacomEvent;
use input::{InputDevice, InputEvent};

#[cfg(feature="enable-runtime-benchmarking")]
#[cfg(feature = "enable-runtime-benchmarking")]
use stopwatch;

unsafe impl<'a> Send for ApplicationContext<'a> {}
Expand Down Expand Up @@ -326,7 +326,6 @@ impl<'a> ApplicationContext<'a> {
}
}


pub fn draw_elements(&mut self) {
start_bench!(stopwatch, draw_elements);
let mut elems: std::vec::Vec<UIElementHandle> = self
Expand Down
24 changes: 14 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
#![feature(integer_atomics)]
#![feature(const_size_of)]

#[cfg(not(feature="enable-runtime-benchmarking"))]
#[cfg(not(feature = "enable-runtime-benchmarking"))]
#[macro_export]
macro_rules! start_bench {
($stopwatch_path:ident, $name:ident) => ();
($stopwatch_path:ident, $name:ident) => {};
}

#[cfg(not(feature="enable-runtime-benchmarking"))]
#[cfg(not(feature = "enable-runtime-benchmarking"))]
#[macro_export]
macro_rules! end_bench {
($name:expr) => ();
($name:expr) => {};
}

#[cfg(feature="enable-runtime-benchmarking")]
#[cfg(feature = "enable-runtime-benchmarking")]
#[macro_export]
macro_rules! start_bench {
($stopwatch_path:ident, $name:ident) => (let $name = $stopwatch_path::Stopwatch::start_new(););
($stopwatch_path:ident, $name:ident) => {
let $name = $stopwatch_path::Stopwatch::start_new();
};
}

#[cfg(feature="enable-runtime-benchmarking")]
#[cfg(feature = "enable-runtime-benchmarking")]
#[macro_export]
macro_rules! end_bench {
($name:ident) => (println!("'{}' took {}ms", stringify!($name), $name.elapsed_ms()););
($name:ident) => {
println!("'{}' took {}ms", stringify!($name), $name.elapsed_ms());
};
}

#[macro_use]
Expand All @@ -41,8 +45,8 @@ extern crate zstd;
pub extern crate epoll;
pub extern crate evdev;
pub extern crate image;
pub extern crate stopwatch;
pub extern crate line_drawing;
pub extern crate stopwatch;

/// One of the core components, allowing output and refresh of the EInk display
pub mod framebuffer;
Expand All @@ -59,4 +63,4 @@ pub mod battery;
/// You can choose to entirely ignore the `ApplicationContext` and `ui_extensions` and interact
/// with the `framebuffer` and `input` devices directly.
pub mod appctx;
pub mod ui_extensions;
pub mod ui_extensions;

0 comments on commit c38a38e

Please sign in to comment.