Skip to content

Commit

Permalink
refactor: use shorthand fields
Browse files Browse the repository at this point in the history
  • Loading branch information
teresy committed Nov 6, 2018
1 parent 861e577 commit 1d418e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl<'a> Primitives<'a> {
let color = style.get_color(theme);
match *style {
ShapeStyle::Fill(_) => {
let kind = PrimitiveKind::Rectangle { color: color };
let kind = PrimitiveKind::Rectangle { color };
return Some(new_primitive(id, kind, scizzor, rect));
},
ShapeStyle::Outline(ref line_style) => {
Expand Down Expand Up @@ -652,7 +652,7 @@ impl<'a> Primitives<'a> {
match kind {

PrimitiveKind::Rectangle { color } => {
let kind = OwnedPrimitiveKind::Rectangle { color: color };
let kind = OwnedPrimitiveKind::Rectangle { color };
primitives.push(new(kind));
},

Expand Down Expand Up @@ -801,7 +801,7 @@ impl<'a> WalkOwnedPrimitives<'a> {
match *kind {

OwnedPrimitiveKind::Rectangle { color } => {
let kind = PrimitiveKind::Rectangle { color: color };
let kind = PrimitiveKind::Rectangle { color };
new(kind)
},

Expand Down
2 changes: 1 addition & 1 deletion src/widget/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl<D, S> List<D, S>
style: style,
num_items: num_items,
item_instantiation: ItemInstantiation::OnlyVisible,
item_size: Fixed { length: length },
item_size: Fixed { length },
direction: std::marker::PhantomData,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/widget/list_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl<M, D, S> ListSelect<M, D, S>
num_items: num_items,
mode: mode,
direction: direction,
item_size: widget::list::Fixed { length: length },
item_size: widget::list::Fixed { length },
style: style,
item_instantiation: widget::list::ItemInstantiation::OnlyVisible,
}
Expand Down

0 comments on commit 1d418e3

Please sign in to comment.