#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))]
pub mod boundary_stream;
pub mod file_format;
pub mod source;
pub mod utils;
pub use file_format::*;
#[cfg(test)]
pub(crate) mod test_utils {
use std::sync::Arc;
use bytes::Bytes;
use object_store::chunked::ChunkedStore;
use object_store::memory::InMemory;
use object_store::path::Path;
use object_store::{ObjectStore, ObjectStoreExt, PutPayload};
pub const CHUNK_SIZES: &[usize] = &[1, 2, 3, 4, 5, 7, 8, 11, 13, 16, usize::MAX];
pub async fn make_chunked_store(
data: &[u8],
chunk_size: usize,
) -> (Arc<dyn ObjectStore>, Path) {
let inner = Arc::new(InMemory::new());
let path = Path::from("test");
inner
.put(&path, PutPayload::from(Bytes::copy_from_slice(data)))
.await
.unwrap();
(Arc::new(ChunkedStore::new(inner, chunk_size)), path)
}
}