Make clippy happy

This commit is contained in:
Héctor Ramón Jiménez 2019-08-31 06:20:56 +02:00
parent 1cd96d0d61
commit 6fbba6f4ee
8 changed files with 31 additions and 28 deletions

View file

@ -10,6 +10,7 @@ use crate::{
/// A [`Column`] will try to fill the horizontal space of its container.
///
/// [`Column`]: struct.Column.html
#[derive(Default)]
pub struct Column<'a, Message, Renderer> {
style: Style,
spacing: u16,
@ -144,7 +145,7 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
let mut style = node.0.style();
style.margin.bottom =
stretch::style::Dimension::Points(self.spacing as f32);
stretch::style::Dimension::Points(f32::from(self.spacing));
node.0.set_style(style);
node

View file

@ -10,6 +10,7 @@ use crate::{
/// A [`Row`] will try to fill the horizontal space of its container.
///
/// [`Row`]: struct.Row.html
#[derive(Default)]
pub struct Row<'a, Message, Renderer> {
style: Style,
spacing: u16,
@ -141,7 +142,7 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
let mut style = node.0.style();
style.margin.end =
stretch::style::Dimension::Points(self.spacing as f32);
stretch::style::Dimension::Points(f32::from(self.spacing));
node.0.set_style(style);
node

View file

@ -112,7 +112,7 @@ where
Renderer: self::Renderer<Color>,
{
fn node(&self, renderer: &Renderer) -> Node {
renderer.node(self.style, &self.content, self.size as f32)
renderer.node(self.style, &self.content, f32::from(self.size))
}
fn draw(
@ -124,7 +124,7 @@ where
renderer.draw(
layout.bounds(),
&self.content,
self.size as f32,
f32::from(self.size),
self.color,
self.horizontal_alignment,
self.vertical_alignment,