mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
build(deps): bump the dependencies group with 19 updates (#1745)
This commit is contained in:
@@ -505,7 +505,7 @@ pub fn get_content_checksum(headers: &HeaderMap) -> Result<Option<Checksum>, std
|
||||
|
||||
for header in trailing_headers {
|
||||
let mut duplicates = false;
|
||||
for &checksum_type in crate::checksum::BASE_CHECKSUM_TYPES {
|
||||
for &checksum_type in BASE_CHECKSUM_TYPES {
|
||||
if let Some(key) = checksum_type.key()
|
||||
&& header.eq_ignore_ascii_case(key)
|
||||
{
|
||||
@@ -570,17 +570,17 @@ fn get_content_checksum_direct(headers: &HeaderMap) -> (ChecksumType, String) {
|
||||
if checksum_type.is_set()
|
||||
&& let Some(key) = checksum_type.key()
|
||||
{
|
||||
if let Some(value) = headers.get(key).and_then(|v| v.to_str().ok()) {
|
||||
return (checksum_type, value.to_string());
|
||||
return if let Some(value) = headers.get(key).and_then(|v| v.to_str().ok()) {
|
||||
(checksum_type, value.to_string())
|
||||
} else {
|
||||
return (ChecksumType::NONE, String::new());
|
||||
}
|
||||
(ChecksumType::NONE, String::new())
|
||||
};
|
||||
}
|
||||
return (checksum_type, String::new());
|
||||
}
|
||||
|
||||
// Check individual checksum headers
|
||||
for &ct in crate::checksum::BASE_CHECKSUM_TYPES {
|
||||
for &ct in BASE_CHECKSUM_TYPES {
|
||||
if let Some(key) = ct.key()
|
||||
&& let Some(value) = headers.get(key).and_then(|v| v.to_str().ok())
|
||||
{
|
||||
|
||||
@@ -439,6 +439,7 @@ mod tests {
|
||||
use crate::WarpReader;
|
||||
|
||||
use super::*;
|
||||
use rand::RngExt;
|
||||
use std::io::Cursor;
|
||||
use tokio::io::{AsyncReadExt, BufReader};
|
||||
|
||||
@@ -494,7 +495,6 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_compress_reader_large() {
|
||||
use rand::Rng;
|
||||
// Generate 1MB of random bytes
|
||||
let mut data = vec![0u8; 1024 * 1024 * 32];
|
||||
rand::rng().fill(&mut data[..]);
|
||||
@@ -513,7 +513,6 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_compress_reader_large_deflate() {
|
||||
use rand::Rng;
|
||||
// Generate 1MB of random bytes
|
||||
let mut data = vec![0u8; 1024 * 1024 * 3 + 512];
|
||||
rand::rng().fill(&mut data[..]);
|
||||
|
||||
@@ -487,7 +487,7 @@ mod tests {
|
||||
use crate::WarpReader;
|
||||
|
||||
use super::*;
|
||||
use rand::RngCore;
|
||||
use rand::{Rng, RngExt};
|
||||
use tokio::io::{AsyncReadExt, BufReader};
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -112,6 +112,7 @@ mod tests {
|
||||
use crate::WarpReader;
|
||||
|
||||
use super::*;
|
||||
use rand::RngExt;
|
||||
use std::io::Cursor;
|
||||
use tokio::io::{AsyncReadExt, BufReader};
|
||||
|
||||
@@ -191,7 +192,6 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_etag_reader_large_data() {
|
||||
use rand::Rng;
|
||||
// Generate 3MB random data
|
||||
let size = 3 * 1024 * 1024;
|
||||
let mut data = vec![0u8; size];
|
||||
|
||||
@@ -562,6 +562,7 @@ impl TryGetIndex for HashReader {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{DecryptReader, WarpReader, encrypt_reader};
|
||||
use rand::RngExt;
|
||||
use std::io::Cursor;
|
||||
use tokio::io::{AsyncReadExt, BufReader};
|
||||
|
||||
@@ -656,7 +657,6 @@ mod tests {
|
||||
use crate::{CompressReader, DecompressReader};
|
||||
use md5::{Digest, Md5};
|
||||
use rand::Rng;
|
||||
use rand::RngCore;
|
||||
use rustfs_utils::compress::CompressionAlgorithm;
|
||||
|
||||
// Generate 1MB random data
|
||||
|
||||
@@ -122,9 +122,9 @@ impl<R> TryGetIndex for LimitReader<R> where R: AsyncRead + Unpin + Send + Sync
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::io::Cursor;
|
||||
|
||||
use super::*;
|
||||
use rand::RngExt;
|
||||
use std::io::Cursor;
|
||||
use tokio::io::{AsyncReadExt, BufReader};
|
||||
|
||||
#[tokio::test]
|
||||
@@ -186,7 +186,6 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_limit_reader_large_file() {
|
||||
use rand::Rng;
|
||||
// Generate a 3MB random byte array for testing
|
||||
let size = 3 * 1024 * 1024;
|
||||
let mut data = vec![0u8; size];
|
||||
|
||||
@@ -77,11 +77,7 @@ impl Writer {
|
||||
}
|
||||
|
||||
impl AsyncWrite for Writer {
|
||||
fn poll_write(
|
||||
self: std::pin::Pin<&mut Self>,
|
||||
cx: &mut std::task::Context<'_>,
|
||||
buf: &[u8],
|
||||
) -> std::task::Poll<std::io::Result<usize>> {
|
||||
fn poll_write(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>, buf: &[u8]) -> std::task::Poll<std::io::Result<usize>> {
|
||||
match self.get_mut() {
|
||||
Writer::Cursor(w) => Pin::new(w).poll_write(cx, buf),
|
||||
Writer::Http(w) => Pin::new(w).poll_write(cx, buf),
|
||||
@@ -89,14 +85,14 @@ impl AsyncWrite for Writer {
|
||||
}
|
||||
}
|
||||
|
||||
fn poll_flush(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::io::Result<()>> {
|
||||
fn poll_flush(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::io::Result<()>> {
|
||||
match self.get_mut() {
|
||||
Writer::Cursor(w) => Pin::new(w).poll_flush(cx),
|
||||
Writer::Http(w) => Pin::new(w).poll_flush(cx),
|
||||
Writer::Other(w) => Pin::new(w.as_mut()).poll_flush(cx),
|
||||
}
|
||||
}
|
||||
fn poll_shutdown(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::io::Result<()>> {
|
||||
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::io::Result<()>> {
|
||||
match self.get_mut() {
|
||||
Writer::Cursor(w) => Pin::new(w).poll_shutdown(cx),
|
||||
Writer::Http(w) => Pin::new(w).poll_shutdown(cx),
|
||||
|
||||
Reference in New Issue
Block a user