diff --git a/crates/rrg/src/action/get_file_contents.rs b/crates/rrg/src/action/get_file_contents.rs index f796b944..191cc0ad 100644 --- a/crates/rrg/src/action/get_file_contents.rs +++ b/crates/rrg/src/action/get_file_contents.rs @@ -137,11 +137,6 @@ impl crate::request::Args for Args { let len = match proto.length() { 0 => usize::MAX, - len if len > MAX_BLOB_LEN as u64 => { - return Err(ParseArgsError::invalid_field("length", LenError { - len, - })); - } len => len as usize, }; @@ -213,26 +208,6 @@ impl std::fmt::Display for FileErrorKind { } } -/// An error indicating that the action was invoked with invalid length. -#[derive(Debug)] -struct LenError { - len: u64, -} - -impl std::fmt::Display for LenError { - - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - write! { - fmt, - "provided length ({}) is bigger than allowed ({})", - self.len, MAX_BLOB_LEN - } - } -} - -impl std::error::Error for LenError { -} - #[cfg(test)] mod tests { diff --git a/crates/rrg/src/action/get_file_contents_kmx.rs b/crates/rrg/src/action/get_file_contents_kmx.rs index 0257362a..4edad9d1 100644 --- a/crates/rrg/src/action/get_file_contents_kmx.rs +++ b/crates/rrg/src/action/get_file_contents_kmx.rs @@ -254,11 +254,6 @@ impl crate::request::Args for Args { let len = match proto.length() { 0 => usize::MAX, - len if len > MAX_BLOB_LEN as u64 => { - return Err(ParseArgsError::invalid_field("length", LenError { - len, - })); - }, len => len as usize, }; @@ -346,26 +341,6 @@ impl std::fmt::Display for FileErrorKind { } } -/// An error indicating that the action was invoked with invalid length. -#[derive(Debug)] -struct LenError { - len: u64, -} - -impl std::fmt::Display for LenError { - - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - write! { - fmt, - "provided length ({}) is bigger than allowed ({})", - self.len, MAX_BLOB_LEN - } - } -} - -impl std::error::Error for LenError { -} - #[cfg(test)] mod tests {