Merge branch 'Resolve-all-'#-allow(clippy--if_same_then_else)]'-error-supressions' into 'master'

Resolve all '#[allow(clippy::if_same_then_else)]' error supressions

See merge request veloren/veloren!2602
This commit is contained in:
Marcel 2021-07-15 21:07:56 +00:00
commit 5391a612c1
6 changed files with 4 additions and 14 deletions

View File

@ -442,7 +442,6 @@ impl<'a> MapConfig<'a> {
/// sample_wpos is a simple function that, given a *column* position,
/// returns the approximate altitude at that column. When in doubt, try
/// using `MapConfig::sample_wpos` for this.
#[allow(clippy::if_same_then_else)] // TODO: Pending review in #587
#[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587
#[allow(clippy::many_single_char_names)]
pub fn generate(

View File

@ -60,7 +60,6 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
type Sample = Option<ColumnSample<'a>>;
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
#[allow(clippy::if_same_then_else)] // TODO: Pending review in #587
#[allow(clippy::nonminimal_bool)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn get(&self, (wpos, index): Self::Index) -> Option<ColumnSample<'a>> {
@ -337,11 +336,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
} else {
let neighbor_pos =
river_chunk_idx.map(|e| e as f64) * neighbor_coef;
if dist.y == 0.0 {
-(wposf - neighbor_pos).magnitude()
} else {
-(wposf - neighbor_pos).magnitude()
}
-(wposf - neighbor_pos).magnitude()
};
(Reverse((dist.x, dist.y)), downhill_height)
});

View File

@ -41,7 +41,6 @@ static MODEL_RAND: RandomPerm = RandomPerm::new(0xDB21C052);
static UNIT_CHOOSER: UnitChooser = UnitChooser::new(0x700F4EC7);
static QUIRKY_RAND: RandomPerm = RandomPerm::new(0xA634460F);
#[allow(clippy::if_same_then_else)]
pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) {
// TODO: Get rid of this
enum TreeModel {

View File

@ -2149,7 +2149,6 @@ pub struct RegionInfo {
}
impl SimChunk {
#[allow(clippy::if_same_then_else)] // TODO: Pending review in #587
#[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587
fn generate(map_size_lg: MapSizeLg, posi: usize, gen_ctx: &GenCtx, gen_cdf: &GenCdf) -> Self {
let pos = uniform_idx_as_vec2(map_size_lg, posi);

View File

@ -244,7 +244,6 @@ impl Archetype for House {
(this, skel)
}
#[allow(clippy::if_same_then_else)] // TODO: Pending review in #587
fn draw(
&self,
index: IndexRef,
@ -455,9 +454,9 @@ impl Archetype for House {
if bound_offset.x == bound_offset.y || profile.y == ceil_height {
// Support beams
return log;
} else if !attr.storey_fill.has_lower() && profile.y < ceil_height {
return EMPTY;
} else if !attr.storey_fill.has_upper() {
} else if !attr.storey_fill.has_lower() && profile.y < ceil_height
|| !attr.storey_fill.has_upper()
{
return EMPTY;
} else {
let (frame_bounds, frame_borders) = if profile.y >= ceil_height {

View File

@ -108,7 +108,6 @@ impl Archetype for Keep {
)
}
#[allow(clippy::if_same_then_else)] // TODO: Pending review in #587
fn draw(
&self,
index: IndexRef,