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

refactor: format & specific compilation condition scope #102

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions examples/opfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub async fn async_reader() {
assert_eq!(expected, read);
web_sys::console::log_1(&format!("read data: {:?} from parquet", read).into());
}

#[wasm_bindgen]
pub async fn remove_all_dir() {
let fs_options = FsOptions::Local;
Expand Down
4 changes: 4 additions & 0 deletions fusio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ readme = "../README.md"
repository.workspace = true
version = "0.3.3"

[package.metadata.docs.rs]
all-features = true

[features]
aws = [
"base64",
Expand Down Expand Up @@ -49,6 +52,7 @@ opfs = [
tokio = ["async-stream", "dep:tokio"]
tokio-http = ["dep:reqwest", "http"]
tokio-uring = ["async-stream", "completion-based", "dep:tokio-uring", "no-send"]

[[bench]]
harness = false
name = "tokio"
Expand Down
1 change: 1 addition & 0 deletions fusio/src/impls/remotes/aws/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl AmazonS3Builder {
};

AmazonS3 {
#[allow(clippy::arc_with_non_send_sync)]
inner: Arc::new(AmazonS3Inner {
options: S3Options {
endpoint,
Expand Down
1 change: 1 addition & 0 deletions fusio/src/impls/remotes/aws/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ impl Write for S3File {
async fn write_all<B: IoBuf>(&mut self, buf: B) -> (Result<(), Error>, B) {
self.writer
.get_or_insert_with(|| {
#[allow(clippy::arc_with_non_send_sync)]
S3Writer::new(Arc::new(MultipartUpload::new(
self.fs.clone(),
self.path.clone(),
Expand Down
13 changes: 9 additions & 4 deletions fusio/src/lib.rs
ethe marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ pub unsafe trait MaybeSync: Sync {
}

#[cfg(feature = "no-send")]
pub unsafe trait MaybeSync {}
pub unsafe trait MaybeSync {
//! Same as [`MaybeSend`], but for [`std::marker::Sync`].
//!
//! # Safety
//! Do not implement it directly.
}

#[cfg(not(feature = "no-send"))]
unsafe impl<T: Sync> MaybeSync for T {}
Expand Down Expand Up @@ -208,7 +213,6 @@ impl<W: Write> Write for &mut W {
}

#[cfg(test)]
#[cfg(not(target_arch = "wasm32"))]
mod tests {
use super::{Read, Write};
use crate::{buf::IoBufMut, Error, IoBuf};
Expand Down Expand Up @@ -322,6 +326,7 @@ mod tests {
}

#[allow(unused)]
#[cfg(not(target_arch = "wasm32"))]
async fn test_local_fs<S>(fs: S) -> Result<(), Error>
where
S: crate::fs::Fs,
Expand Down Expand Up @@ -395,7 +400,7 @@ mod tests {
write_and_read(File::from_std(write), File::from_std(read)).await;
}

#[cfg(feature = "tokio")]
#[cfg(all(feature = "tokio", not(target_arch = "wasm32")))]
#[tokio::test]
async fn test_tokio_fs() {
use crate::disk::TokioFs;
Expand All @@ -422,7 +427,7 @@ mod tests {
}
}

#[cfg(feature = "monoio")]
#[cfg(all(feature = "monoio", not(target_arch = "wasm32")))]
#[monoio::test]
async fn test_monoio() {
use monoio::fs::File;
Expand Down
Loading