working through clippy errors

This commit is contained in:
Henry Schimke
2022-10-14 17:40:16 -05:00
parent 875fc6a05b
commit 27f491ffaa
5 changed files with 14 additions and 15 deletions

View File

@@ -1351,9 +1351,6 @@ pub struct Dimension {
impl Dimension {
pub fn new(width: usize, height: usize) -> Result<Self, Exceptions> {
if width < 0 || height < 0 {
return Err(Exceptions::IllegalArgumentException("".to_owned()));
}
Ok(Self { width, height })
}
@@ -2028,7 +2025,7 @@ impl PlanarYUVLuminanceSource {
impl LuminanceSource for PlanarYUVLuminanceSource {
fn getRow(&self, y: usize, row: &Vec<u8>) -> Vec<u8> {
if y < 0 || y >= self.getHeight() {
if y >= self.getHeight() {
//throw new IllegalArgumentException("Requested row is outside the image: " + y);
panic!("Requested row is outside the image: {}", y);
}
@@ -2178,7 +2175,7 @@ pub struct RGBLuminanceSource {
impl LuminanceSource for RGBLuminanceSource {
fn getRow(&self, y: usize, row: &Vec<u8>) -> Vec<u8> {
if y < 0 || y >= self.getHeight() {
if y >= self.getHeight() {
panic!("Requested row is outside the image: {}", y);
}
let width = self.getWidth();