clippy++
This commit is contained in:
parent
9289a829be
commit
26a8924bc8
@ -46,7 +46,7 @@ impl Default for BoundSurface<Rc<RefCell<ShaderBinding>>>{
|
|||||||
|
|
||||||
impl Surface for BoundSurface<Rc<RefCell<ShaderBinding>>> {
|
impl Surface for BoundSurface<Rc<RefCell<ShaderBinding>>> {
|
||||||
fn rect(&self) -> Rectangle<Virtual> {
|
fn rect(&self) -> Rectangle<Virtual> {
|
||||||
self.binding.borrow().rect.clone()
|
self.binding.borrow().rect
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_shader<F: FnMut(&dyn Shader)>(&self, mut f: F) {
|
fn with_shader<F: FnMut(&dyn Shader)>(&self, mut f: F) {
|
||||||
@ -64,7 +64,7 @@ impl Surface for BoundSurface<Rc<RefCell<ShaderBinding>>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_rect(&mut self, rect: &Rectangle<Virtual>) {
|
fn set_rect(&mut self, rect: &Rectangle<Virtual>) {
|
||||||
self.binding.borrow_mut().rect = rect.clone();
|
self.binding.borrow_mut().rect = *rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn opacity(&self) -> u8 {
|
fn opacity(&self) -> u8 {
|
||||||
|
@ -118,11 +118,11 @@ impl<Space: CoordinateSpace> Rectangle<Space> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn width(&self) -> Space::Data {
|
pub fn width(&self) -> Space::Data {
|
||||||
self.bottom_right.x.clone() - self.top_left.x.clone()
|
self.bottom_right.x - self.top_left.x
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn height(&self) -> Space::Data {
|
pub fn height(&self) -> Space::Data {
|
||||||
self.bottom_right.y.clone() - self.top_left.y.clone()
|
self.bottom_right.y - self.top_left.y
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn left(&self) -> Space::Data {
|
pub const fn left(&self) -> Space::Data {
|
||||||
|
@ -17,7 +17,7 @@ pub trait Select<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct LinearCoordView {
|
pub struct LinearCoordView {
|
||||||
rect: Rectangle<Virtual>,
|
rect: Rectangle<Virtual>,
|
||||||
idx: usize,
|
idx: usize,
|
||||||
}
|
}
|
||||||
@ -165,17 +165,17 @@ impl<const STRIDE_NUM: usize> StrideMapping<STRIDE_NUM> {
|
|||||||
physical_idx += length as usize;
|
physical_idx += length as usize;
|
||||||
size = Some(match size.take() {
|
size = Some(match size.take() {
|
||||||
None => Rectangle::new(
|
None => Rectangle::new(
|
||||||
Coordinates::new(x.into(), y.into()),
|
Coordinates::new(x, y),
|
||||||
Coordinates::new(x.into(), (y + length - 1).into()),
|
Coordinates::new(x, (y + length - 1)),
|
||||||
),
|
),
|
||||||
Some(s) => Rectangle::new(
|
Some(s) => Rectangle::new(
|
||||||
Coordinates::new(
|
Coordinates::new(
|
||||||
min(s.top_left.x, x.into()),
|
min(s.top_left.x, x),
|
||||||
min(s.top_left.y, y.into())
|
min(s.top_left.y, y)
|
||||||
),
|
),
|
||||||
Coordinates::new(
|
Coordinates::new(
|
||||||
max(s.bottom_right.x, x.into()),
|
max(s.bottom_right.x, x),
|
||||||
max(s.bottom_right.y, (y + length - 1).into())
|
max(s.bottom_right.y, (y + length - 1))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
@ -260,7 +260,7 @@ impl<'a> StrideView<'a> {
|
|||||||
map,
|
map,
|
||||||
range,
|
range,
|
||||||
step_size,
|
step_size,
|
||||||
cur: range.top_left.clone()
|
cur: range.top_left
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ impl<'a> CoordinateView<'a> for StrideView<'a> {
|
|||||||
debug_assert!(self.cur.y <= cur_stride.y + cur_stride.length - 1, "coords={:?} out of bounds for stride={:?} view={:?}", self.cur, cur_stride, self);
|
debug_assert!(self.cur.y <= cur_stride.y + cur_stride.length - 1, "coords={:?} out of bounds for stride={:?} view={:?}", self.cur, cur_stride, self);
|
||||||
|
|
||||||
// Move to the next coord and return
|
// Move to the next coord and return
|
||||||
let physical_coords = self.cur.clone();
|
let physical_coords = self.cur;
|
||||||
self.cur.y += 1;
|
self.cur.y += 1;
|
||||||
|
|
||||||
let virtual_coords = VirtualCoordinates::new(
|
let virtual_coords = VirtualCoordinates::new(
|
||||||
|
@ -9,7 +9,7 @@ impl AsMilliwatts for RGB8 {
|
|||||||
const RED_MW : u32 = 16 * 5; //< 16mA @ 5v = 80mW
|
const RED_MW : u32 = 16 * 5; //< 16mA @ 5v = 80mW
|
||||||
const GREEN_MW : u32 = 11 * 5; //< 11mA @ 5v = 55mW
|
const GREEN_MW : u32 = 11 * 5; //< 11mA @ 5v = 55mW
|
||||||
const BLUE_MW : u32 = 15 * 5; //< 15mA @ 5v = 75mW
|
const BLUE_MW : u32 = 15 * 5; //< 15mA @ 5v = 75mW
|
||||||
const DARK_MW : u32 = 1 * 5; //< 1mA @ 5v = 5mW
|
const DARK_MW : u32 = 5; //< 1mA @ 5v = 5mW
|
||||||
|
|
||||||
let red = (self.r as u32 * RED_MW).wrapping_shr(8);
|
let red = (self.r as u32 * RED_MW).wrapping_shr(8);
|
||||||
let green = (self.g as u32 * GREEN_MW).wrapping_shr(8);
|
let green = (self.g as u32 * GREEN_MW).wrapping_shr(8);
|
||||||
|
@ -65,7 +65,7 @@ impl<T: Display<S>, S: Surface> Renderer<T, S> {
|
|||||||
display,
|
display,
|
||||||
fps: RealTimeRunningAverage::default(),
|
fps: RealTimeRunningAverage::default(),
|
||||||
fps_display: Periodically::new_every_n_seconds(5),
|
fps_display: Periodically::new_every_n_seconds(5),
|
||||||
_sfc: PhantomData::default()
|
_sfc: PhantomData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user