Skip to content

Commit

Permalink
Running rustfmt 1.28
Browse files Browse the repository at this point in the history
  • Loading branch information
not-avail committed Jun 22, 2018
1 parent c38a0a6 commit 8ac1b7a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/appctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ impl<'a> ApplicationContext<'a> {
}

pub fn draw_elements(&mut self) {
let mut elems: std::vec::Vec<UIElementHandle> = self.ui_elements
let mut elems: std::vec::Vec<UIElementHandle> = self
.ui_elements
.iter()
.map(|(_key, value)| value.clone())
.collect();
Expand Down
4 changes: 3 additions & 1 deletion src/framebuffer/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ impl mxcfb_rect {

impl mxcfb_rect {
pub fn contains_point(&self, y: u32, x: u32) -> bool {
!(x < self.left || x > (self.left + self.width) || y < self.top
!(x < self.left
|| x > (self.left + self.width)
|| y < self.top
|| y > (self.top + self.height))
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/framebuffer/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ fn sample_bezier(startpt: (f32, f32), ctrlpt: (f32, f32), endpt: (f32, f32)) ->
for i in 0..1000 {
let t = (i as f32) / 1000.0;
let precisept = (
(1.0 - t).powf(2.0) * startpt.0 + 2.0 * (1.0 - t) * t * ctrlpt.0
(1.0 - t).powf(2.0) * startpt.0
+ 2.0 * (1.0 - t) * t * ctrlpt.0
+ t.powf(2.0) * endpt.0,
(1.0 - t).powf(2.0) * startpt.1 + 2.0 * (1.0 - t) * t * ctrlpt.1
(1.0 - t).powf(2.0) * startpt.1
+ 2.0 * (1.0 - t) * t * ctrlpt.1
+ t.powf(2.0) * endpt.1,
);
let pt = (precisept.0 as i32, precisept.1 as i32);
Expand Down
3 changes: 2 additions & 1 deletion src/framebuffer/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ impl<'a> framebuffer::FramebufferIO for framebuffer::core::Framebuffer<'a> {
x,
y,
Rgba {
data: self.read_pixel((rect.top + y) as usize, (rect.left + x) as usize)
data: self
.read_pixel((rect.top + y) as usize, (rect.left + x) as usize)
.as_native(),
},
);
Expand Down
3 changes: 2 additions & 1 deletion src/input/ev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ impl EvDevContext {
Err(e) => error!("Error while reading events from epoll fd: {0}", e),
Ok(mut dev) => {
let mut v = vec![epoll::Event {
events: (epoll::Events::EPOLLET | epoll::Events::EPOLLIN
events: (epoll::Events::EPOLLET
| epoll::Events::EPOLLIN
| epoll::Events::EPOLLPRI)
.bits(),
data: 0,
Expand Down

0 comments on commit 8ac1b7a

Please sign in to comment.