Skip to content

Commit bf8a546

Browse files
authored
Merge pull request #25 from TheQuantumPhysicist/fix/remove-unnecessary-trait-bounds
Remove unnecessary trait bounds
2 parents f609f2e + dc5165a commit bf8a546

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/backends.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ pub enum EndianCorrection {
121121
/// A backend for [`FrameBuf`](crate::FrameBuf) which changes the underlying
122122
/// byte order. This can be useful when using the buffer for DMA with
123123
/// peripherals that have a different endianness than the host.
124-
pub struct EndianCorrectedBuffer<'a, C: PixelColor> {
124+
pub struct EndianCorrectedBuffer<'a, C> {
125125
data: &'a mut [C],
126126
endian: EndianCorrection,
127127
}
128-
impl<'a, C: PixelColor> EndianCorrectedBuffer<'a, C> {
128+
impl<'a, C> EndianCorrectedBuffer<'a, C> {
129129
pub fn new(data: &'a mut [C], endian: EndianCorrection) -> Self {
130130
Self { data, endian }
131131
}

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ use backends::{DMACapableFrameBufferBackend, FrameBufferBackend};
7979
/// ```
8080
// TODO: Once https://github.com/rust-lang/rust/issues/76560 is resolved, change this to `pub struct
8181
// FrameBuf<C: PixelColor, const X: usize, const Y: usize>(pub [C; X * Y]);`
82-
pub struct FrameBuf<C: PixelColor, B: FrameBufferBackend<Color = C>> {
82+
pub struct FrameBuf<C, B: FrameBufferBackend<Color = C>> {
8383
pub data: B,
8484
width: usize,
8585
height: usize,
8686
origin: Point,
8787
}
8888

89-
impl<C: PixelColor, B: FrameBufferBackend<Color = C>> FrameBuf<C, B> {
89+
impl<C, B: FrameBufferBackend<Color = C>> FrameBuf<C, B> {
9090
/// Create a new [`FrameBuf`] on top of an existing memory slice.
9191
///
9292
/// # Panic
@@ -210,7 +210,7 @@ impl<'a, C: PixelColor, B: FrameBufferBackend<Color = C>> IntoIterator for &'a F
210210
}
211211
}
212212

213-
impl<C: PixelColor, B: FrameBufferBackend<Color = C>> OriginDimensions for FrameBuf<C, B> {
213+
impl<C, B: FrameBufferBackend<Color = C>> OriginDimensions for FrameBuf<C, B> {
214214
fn size(&self) -> Size {
215215
self.size()
216216
}
@@ -247,7 +247,7 @@ impl<C: PixelColor, B: FrameBufferBackend<Color = C>> DrawTarget for FrameBuf<C,
247247
}
248248

249249
/// An iterator for all [Pixels](Pixel) in the framebuffer.
250-
pub struct PixelIterator<'a, C: PixelColor, B: FrameBufferBackend<Color = C>> {
250+
pub struct PixelIterator<'a, C, B: FrameBufferBackend<Color = C>> {
251251
fbuf: &'a FrameBuf<C, B>,
252252
index: usize,
253253
}
@@ -267,7 +267,7 @@ impl<'a, C: PixelColor, B: FrameBufferBackend<Color = C>> Iterator for PixelIter
267267
}
268268
}
269269

270-
unsafe impl<C: PixelColor, B: DMACapableFrameBufferBackend<Color = C>> ReadBuffer
270+
unsafe impl<C, B: DMACapableFrameBufferBackend<Color = C>> ReadBuffer
271271
for FrameBuf<C, B>
272272
{
273273
type Word = u8;
@@ -281,7 +281,7 @@ unsafe impl<C: PixelColor, B: DMACapableFrameBufferBackend<Color = C>> ReadBuffe
281281
}
282282
}
283283

284-
unsafe impl<C: PixelColor, B: DMACapableFrameBufferBackend<Color = C>> WriteBuffer
284+
unsafe impl<C, B: DMACapableFrameBufferBackend<Color = C>> WriteBuffer
285285
for FrameBuf<C, B>
286286
{
287287
type Word = u8;

0 commit comments

Comments
 (0)