Re-disable incremental just for common-systems, small fix in plugin

crate, more new clippy fixes
This commit is contained in:
Imbris 2021-05-16 14:52:24 -04:00
parent 48ebb10d50
commit 23eca4c3f6
13 changed files with 25 additions and 19 deletions

View File

@ -44,6 +44,8 @@ opt-level = 2
opt-level = 3
[profile.dev.package."veloren-common"]
opt-level = 2
[profile.dev.package."veloren-common-systems"]
incremental = false
[profile.dev.package."veloren-client"]
opt-level = 2
[profile.dev.package."veloren-server"]

View File

@ -257,7 +257,7 @@ impl<'a> System<'a> for Sys {
}
// Controller actions
let actions = std::mem::replace(&mut controller.actions, Vec::new());
let actions = std::mem::take(&mut controller.actions);
let mut join_struct = JoinStruct {
entity,

View File

@ -1,5 +1,3 @@
#![feature(const_fn)]
pub extern crate plugin_derive;
pub mod retrieve;

View File

@ -781,10 +781,9 @@ mod tests {
let position = Pos(Vec3::zero());
let item_position = Pos(Vec3::one());
assert_eq!(
within_pickup_range(test_cylinder(position), || test_cylinder(item_position),),
true
);
assert!(within_pickup_range(test_cylinder(position), || {
test_cylinder(item_position)
},),);
}
#[test]
@ -792,9 +791,8 @@ mod tests {
let position = Pos(Vec3::zero());
let item_position = Pos(Vec3::one() * 500.0);
assert_eq!(
within_pickup_range(test_cylinder(position), || test_cylinder(item_position),),
false
);
assert!(!within_pickup_range(test_cylinder(position), || {
test_cylinder(item_position)
},),);
}
}

View File

@ -1,3 +1,5 @@
#![allow(clippy::branches_sharing_code)] // TODO: evaluate
use crate::rtsim::{Entity as RtSimData, RtSim};
use common::{
comp::{

View File

@ -15,7 +15,7 @@ fn no_item_config_no_emit() {
let previous_state = PreviousEntityState::default();
let result = MovementEventMapper::should_emit(&previous_state, None);
assert_eq!(result, false);
assert!(!result);
}
#[test]
@ -39,7 +39,7 @@ fn config_but_played_since_threshold_no_emit() {
Some((&SfxEvent::Run(BlockKind::Grass), &trigger_item)),
);
assert_eq!(result, false);
assert!(!result);
}
#[test]
@ -62,7 +62,7 @@ fn config_and_not_played_since_threshold_emits() {
Some((&SfxEvent::Run(BlockKind::Grass), &trigger_item)),
);
assert_eq!(result, true);
assert!(result);
}
#[test]
@ -87,7 +87,7 @@ fn same_previous_event_elapsed_emits() {
Some((&SfxEvent::Run(BlockKind::Grass), &trigger_item)),
);
assert_eq!(result, true);
assert!(result);
}
#[test]

View File

@ -956,7 +956,7 @@ impl Hud {
interactable: Option<Interactable>,
) -> Vec<Event> {
span!(_guard, "update_layout", "Hud::update_layout");
let mut events = std::mem::replace(&mut self.events, Vec::new());
let mut events = core::mem::take(&mut self.events);
let (ref mut ui_widgets, ref mut item_tooltip_manager, ref mut tooltip_manager) =
&mut self.ui.set_widgets();
// self.ui.set_item_widgets(); pulse time for pulsating elements

View File

@ -1,3 +1,5 @@
#![allow(clippy::clone_on_copy)] // TODO: fix after wgpu branch
use crate::{
mesh::{
greedy::{self, GreedyConfig, GreedyMesh},

View File

@ -79,6 +79,7 @@ impl slider::Renderer for IcedRenderer {
mouse::Interaction::Idle
};
#[allow(clippy::branches_sharing_code)] // TODO: remove
#[allow(clippy::if_same_then_else)] // TODO: remove
let primitives = if style.labels {
// TODO text label on left and right ends

View File

@ -530,6 +530,7 @@ impl Ui {
});
if glyph_missing {
#[allow(clippy::branches_sharing_code)] // TODO: evaluate (ask sharp)
if *retry {
// If a glyph was missing and this was our second try, we know something was
// messed up during the glyph_cache redraw. It is possible that

View File

@ -194,8 +194,8 @@ where
pub fn maintain(&mut self, ui: &mut conrod_core::UiCell) -> Vec<Event<S>> {
// Clear
let slot_ids = std::mem::replace(&mut self.slot_ids, Vec::new());
let slots = std::mem::replace(&mut self.slots, Vec::new());
let slot_ids = core::mem::take(&mut self.slot_ids);
let slots = core::mem::take(&mut self.slots);
// Detect drops by of selected item by clicking in empty space
if let ManagerState::Selected(_, slot) = self.state {
@ -295,7 +295,7 @@ where
// }
}
std::mem::replace(&mut self.events, Vec::new())
core::mem::take(&mut self.events)
}
fn update(

View File

@ -1,3 +1,4 @@
#![allow(clippy::branches_sharing_code)] // TODO: evaluate
use common::{
terrain::{
map::{MapConfig, MapDebug, MapSample},

View File

@ -5,6 +5,7 @@
clippy::blocks_in_if_conditions,
clippy::too_many_arguments
)]
#![allow(clippy::branches_sharing_code)] // TODO: evaluate
#![deny(clippy::clone_on_ref_ptr)]
#![feature(
arbitrary_enum_discriminant,