Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly improve imports in plane.rs #25

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading