Skip to content

Commit

Permalink
Slightly refactor imports in plane.rs
Browse files Browse the repository at this point in the history
- Remove `use std::u32` and `use std::usize` (there is no reason to import these)
- Import `std::mem::size_of` directly instead of just `std::mem` (other
  files in project do the same)
  • Loading branch information
FreezyLemon authored and lu-zero committed Feb 20, 2024
1 parent 0244b29 commit 24fce24
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
// Media Patent License 1.0 was not distributed with this source code in the
// PATENTS file, you can obtain it at www.aomedia.org/license/patent.

use std::fmt::{Debug, Display, Formatter};
use std::iter::{self, FusedIterator};
use std::marker::PhantomData;
use std::mem;
use std::mem::size_of;
use std::ops::{Index, IndexMut, Range};
use std::u32;
use std::{
fmt::{Debug, Display, Formatter},
usize,
};

use aligned_vec::{ABox, AVec, ConstAlign};

Expand Down Expand Up @@ -188,7 +184,7 @@ impl<T: Pixel> Plane<T> {
xpad: usize,
ypad: usize,
) -> Self {
let cfg = PlaneConfig::new(width, height, xdec, ydec, xpad, ypad, mem::size_of::<T>());
let cfg = PlaneConfig::new(width, height, xdec, ydec, xpad, ypad, size_of::<T>());
let data = PlaneData::new(cfg.stride * cfg.alloc_height);

Plane { data, cfg }
Expand Down Expand Up @@ -377,7 +373,7 @@ impl<T: Pixel> Plane<T> {
}
2 => {
assert!(
mem::size_of::<T>() == 2,
size_of::<T>() == 2,
"source bytewidth ({}) cannot fit in Plane<u8>",
source_bytewidth
);
Expand Down Expand Up @@ -424,7 +420,7 @@ impl<T: Pixel> Plane<T> {
}
2 => {
assert!(
mem::size_of::<T>() >= 2,
size_of::<T>() >= 2,
"dest bytewidth ({}) cannot fit in Plane<u8>",
dest_bytewidth
);
Expand Down

0 comments on commit 24fce24

Please sign in to comment.