Reformat using cargofmt

This commit is contained in:
timvisee
2018-09-22 18:30:29 +02:00
parent c37da9b40b
commit bd6b48cd3b
10 changed files with 146 additions and 223 deletions

View File

@@ -7,8 +7,6 @@ use color::Color;
use pix::client::Client;
use rect::Rect;
/// A painter that paints on a pixelflut panel.
pub struct Painter {
client: Client,
@@ -19,7 +17,12 @@ pub struct Painter {
impl Painter {
/// Create a new painter.
pub fn new(client: Client, area: Rect, offset: (u32, u32), image: Option<DynamicImage>) -> Painter {
pub fn new(
client: Client,
area: Rect,
offset: (u32, u32),
image: Option<DynamicImage>,
) -> Painter {
Painter {
client,
area,
@@ -61,15 +64,11 @@ impl Painter {
// Get the pixel at this location
let pixel = image.get_pixel(x, y);
// Get the channels
let channels = pixel.channels();
// Get the channels
let channels = pixel.channels();
// Define the color
let color = Color::from(
channels[0],
channels[1],
channels[2],
);
// Define the color
let color = Color::from(channels[0], channels[1], channels[2]);
// Set the pixel
self.client.write_pixel(