Skip to content

Commit

Permalink
Fix clippy error
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Jul 16, 2019
1 parent 7ff7cae commit d114460
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions amethyst_rendy/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<B: Backend> GraphCreator<B> for RenderingBundleGraphCreator<B> {
}

fn builder(&mut self, factory: &mut Factory<B>, res: &Resources) -> GraphBuilder<B, Resources> {
if self.plugins.len() == 0 {
if self.plugins.is_empty() {
log::warn!("RenderingBundle is configured to display nothing. Use `with_plugin` to add functionality.");
}

Expand Down Expand Up @@ -772,7 +772,7 @@ mod tests {
struct TestGroup2;

impl<B: Backend, T> RenderGroupDesc<B, T> for TestGroup1 {
fn build<'a>(
fn build(
self,
ctx: &GraphContext<B>,
factory: &mut Factory<B>,
Expand All @@ -788,7 +788,7 @@ mod tests {
}
}
impl<B: Backend, T> RenderGroupDesc<B, T> for TestGroup2 {
fn build<'a>(
fn build(
self,
ctx: &GraphContext<B>,
factory: &mut Factory<B>,
Expand Down
7 changes: 4 additions & 3 deletions amethyst_rendy/src/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ impl<B: Backend> RenderPlugin<B> for RenderToWindow {
Ok(())
}

#[allow(clippy::map_clone)]
fn rebuild(&mut self, res: &Resources) -> bool {
let new_dimensions = res.try_fetch::<ScreenDimensions>();
use std::ops::Deref;
Expand All @@ -79,7 +80,7 @@ impl<B: Backend> RenderPlugin<B> for RenderToWindow {
self.dimensions = new_dimensions.map(|d| d.clone());
return false;
}
return self.dirty;
self.dirty
}

fn plan(
Expand Down Expand Up @@ -108,7 +109,7 @@ impl<B: Backend> RenderPlugin<B> for RenderToWindow {
TargetPlanOutputs {
colors: vec![OutputColor::Surface(
surface,
self.clear.map(|c| ClearValue::Color(c)),
self.clear.map(ClearValue::Color),
)],
depth: Some(depth_options),
},
Expand Down Expand Up @@ -293,7 +294,7 @@ impl<B: Backend> RenderPlugin<B> for RenderSkybox {
_factory: &mut Factory<B>,
_res: &Resources,
) -> Result<(), Error> {
let colors = self.colors.clone();
let colors = self.colors;
plan.extend_target(self.target, move |ctx| {
let group = if let Some((nadir, zenith)) = colors {
DrawSkyboxDesc::with_colors(nadir, zenith).builder()
Expand Down
1 change: 1 addition & 0 deletions amethyst_rendy/src/render_test_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ impl<B> GraphCreator<B> for RenderGraph<B>
where
B: Backend,
{
#[allow(clippy::map_clone)]
fn rebuild(&mut self, res: &Resources) -> bool {
// Rebuild when dimensions change, but wait until at least two frames have the same.
let new_dimensions = res.try_fetch::<ScreenDimensions>();
Expand Down
3 changes: 2 additions & 1 deletion book/src/appendices/b_migration_notes/rendy_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
}
impl GraphCreator<DefaultBackend> for RenderGraph {
#[allow(clippy::map_clone)]
fn rebuild(&mut self, res: &Resources) -> bool {
// Rebuild when dimensions change, but wait until at least two frames have the same.
let new_dimensions = res.try_fetch::<ScreenDimensions>();
Expand All @@ -155,7 +156,7 @@
self.dimensions = new_dimensions.map(|d| d.clone());
return false;
}
return self.dirty;
self.dirty
}
fn builder(
Expand Down

0 comments on commit d114460

Please sign in to comment.