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

chore: Format code to make readers happy #3912

Merged
merged 2 commits into from
Jan 4, 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
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
[workspace]
default-members = ["core"]
exclude = [
"examples",
"examples",

"bindings/c",
"bindings/ocaml",
"bindings/php",
"bindings/ruby"
"bindings/c",
"bindings/ocaml",
"bindings/php",
"bindings/ruby",
]
members = [
"core",
Expand Down
10 changes: 5 additions & 5 deletions bin/ofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
// specific language governing permissions and limitations
// under the License.

use fuse3::path::prelude::*;
use fuse3::Result;

use async_trait::async_trait;
use futures_util::stream::{Empty, Iter};
use std::ffi::OsStr;
use std::vec::IntoIter;

use async_trait::async_trait;
use fuse3::path::prelude::*;
use fuse3::Result;
use futures_util::stream::Empty;
use futures_util::stream::Iter;
use opendal::Operator;

pub struct Ofs {
Expand Down
4 changes: 2 additions & 2 deletions bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ services-webhdfs = ["opendal/services-webhdfs"]
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-b2 = ["opendal/services-b2"]
services-upyun = ["opendal/services-upyun"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
services-dropbox = ["opendal/services-dropbox"]
Expand All @@ -138,13 +137,14 @@ services-postgresql = ["opendal/services-postgresql"]
services-redb = ["opendal/services-redb"]
services-redis = ["opendal/services-redis"]
services-rocksdb = ["opendal/services-rocksdb"]
services-seafile = ["opendal/services-seafile"]
services-sftp = ["opendal/services-sftp"]
services-sled = ["opendal/services-sled"]
services-seafile = ["opendal/services-seafile"]
services-sqlite = ["opendal/services-sqlite"]
services-supabase = ["opendal/services-supabase"]
services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]

Expand Down
4 changes: 2 additions & 2 deletions bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ services-webhdfs = ["opendal/services-webhdfs"]
# Optional services provided by opendal.
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-upyun = ["opendal/services-upyun"]
services-b2 = ["opendal/services-b2"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
Expand All @@ -133,13 +132,14 @@ services-postgresql = ["opendal/services-postgresql"]
services-redb = ["opendal/services-redb"]
services-redis = ["opendal/services-redis"]
services-rocksdb = ["opendal/services-rocksdb"]
services-seafile = ["opendal/services-seafile"]
services-sftp = ["opendal/services-sftp"]
services-sled = ["opendal/services-sled"]
services-sqlite = ["opendal/services-sqlite"]
services-seafile = ["opendal/services-seafile"]
services-supabase = ["opendal/services-supabase"]
services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]

Expand Down
4 changes: 2 additions & 2 deletions bindings/php/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# under the License.

[package]
name = "opendal-php"
version = "0.1.0"
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "opendal-php"
repository = "https://github.com/apache/incubator-opendal"
rust-version = "1.67"
version = "0.1.0"

[lib]
crate-type = ["cdylib"]
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ services-webhdfs = ["opendal/services-webhdfs"]
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-b2 = ["opendal/services-b2"]
services-upyun = ["opendal/services-upyun"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
services-dropbox = ["opendal/services-dropbox"]
Expand All @@ -135,13 +134,14 @@ services-postgresql = ["opendal/services-postgresql"]
services-redb = ["opendal/services-redb"]
services-redis = ["opendal/services-redis"]
services-rocksdb = ["opendal/services-rocksdb"]
services-seafile = ["opendal/services-seafile"]
services-sftp = ["opendal/services-sftp"]
services-sled = ["opendal/services-sled"]
services-sqlite = ["opendal/services-sqlite"]
services-seafile = ["opendal/services-seafile"]
services-supabase = ["opendal/services-supabase"]
services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]

Expand Down
18 changes: 9 additions & 9 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,8 @@ services-azdls = [
]
services-azfile = []
services-b2 = []
services-seafile = []
services-upyun = ["dep:hmac", "dep:sha1"]
services-chainsafe = []
services-pcloud = []
services-cacache = ["dep:cacache"]
services-chainsafe = []
services-cloudflare-kv = []
services-cos = [
"dep:reqsign",
Expand All @@ -139,7 +136,7 @@ services-dropbox = []
services-etcd = ["dep:etcd-client", "dep:bb8"]
services-foundationdb = ["dep:foundationdb"]
services-fs = ["tokio/fs"]
services-ftp = ["dep:suppaftp", "dep:bb8", "dep:async-tls" ]
services-ftp = ["dep:suppaftp", "dep:bb8", "dep:async-tls"]
services-gcs = [
"dep:reqsign",
"reqsign?/services-google",
Expand Down Expand Up @@ -171,6 +168,7 @@ services-oss = [
"reqsign?/services-aliyun",
"reqsign?/reqwest_request",
]
services-pcloud = []
services-persy = ["dep:persy"]
services-postgresql = ["dep:tokio-postgres", "dep:bb8", "dep:bb8-postgres"]
services-redb = ["dep:redb"]
Expand All @@ -182,12 +180,14 @@ services-s3 = [
"reqsign?/services-aws",
"reqsign?/reqwest_request",
]
services-seafile = []
services-sftp = ["dep:openssh", "dep:openssh-sftp-client", "dep:dirs"]
services-sled = ["dep:sled"]
services-sqlite = ["dep:rusqlite", "dep:r2d2"]
services-supabase = []
services-swift = []
services-tikv = ["tikv-client"]
services-upyun = ["dep:hmac", "dep:sha1"]
services-vercel-artifacts = []
# Deprecated
# wasabi services support has been removed.
Expand Down Expand Up @@ -219,6 +219,7 @@ required-features = ["tests"]
anyhow = { version = "1.0.30", features = ["std"] }
async-backtrace = { version = "0.2.6", optional = true }
async-compat = "0.2"
async-tls = { version = "0.12.0", optional = true }
async-trait = "0.1.68"
atomic_lib = { version = "0.34.5", optional = true }
await-tree = { version = "0.1.1", optional = true }
Expand Down Expand Up @@ -246,6 +247,7 @@ foundationdb = { version = "0.8.0", features = [
futures = { version = "0.3", default-features = false, features = ["std"] }
governor = { version = "0.6.0", optional = true, features = ["std"] }
hdrs = { version = "0.3.0", optional = true, features = ["async_file"] }
hmac = { version = "0.12.1", optional = true }
hrana-client-proto = { version = "0.2.1", optional = true }
http = "0.2.9"
log = "0.4"
Expand Down Expand Up @@ -290,21 +292,19 @@ rocksdb = { version = "0.21.0", default-features = false, optional = true }
rusqlite = { version = "0.29.0", optional = true, features = ["bundled"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = { version = "0.10", optional = true }
hmac = { version = "0.12.1", optional = true }
sha1 = { version = "0.10.6", optional = true }
sha2 = { version = "0.10", optional = true }
sled = { version = "0.34.7", optional = true }
suppaftp = { version = "5.2", default-features = false, features = [
"async-secure",
"rustls",
"async-rustls",
], optional = true }
tikv-client = { version = "0.3.0", optional = true, default-features = false }
tokio = { version= "1.27",features = ["sync"] }
tokio = { version = "1.27", features = ["sync"] }
tokio-postgres = { version = "0.7.8", optional = true }
tracing = { version = "0.1", optional = true }
uuid = { version = "1", features = ["serde", "v4"] }
async-tls = { version = "0.12.0", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ license.workspace = true

[dependencies]
opendal = { workspace = true, features = ["tests"] }
uuid = { version = "1", features = ["serde", "v4"] }
tokio = { version = "1", features = ["full"] }
uuid = { version = "1", features = ["serde", "v4"] }
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
// under the License.

use opendal::raw::tests::init_test_service;
use opendal::{Result, Scheme};
use opendal::Result;
use opendal::Scheme;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
4 changes: 3 additions & 1 deletion core/edge/s3_read_on_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ license.workspace = true
crate-type = ["cdylib"]

[dependencies]
opendal = { path = "../../", default-features = false, features = ["services-s3"] }
opendal = { path = "../../", default-features = false, features = [
"services-s3",
] }
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4.39"

Expand Down
3 changes: 2 additions & 1 deletion core/edge/s3_read_on_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ pub async fn hello_world() -> String {

#[cfg(test)]
mod tests {
use super::*;
use wasm_bindgen_test::wasm_bindgen_test;
use wasm_bindgen_test::wasm_bindgen_test_configure;

use super::*;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
Expand Down
28 changes: 14 additions & 14 deletions core/src/layers/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,10 @@ mod tests {
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl Accessor for MockService {
type Reader = oio::Reader;
type BlockingReader = oio::BlockingReader;
type Writer = oio::Writer;
type BlockingWriter = oio::BlockingWriter;
type Lister = oio::Lister;
type BlockingReader = oio::BlockingReader;
type BlockingWriter = oio::BlockingWriter;
type BlockingLister = oio::BlockingLister;

fn info(&self) -> AccessorInfo {
Expand All @@ -803,6 +803,10 @@ mod tests {
Ok(RpCreateDir {})
}

async fn stat(&self, _: &str, _: OpStat) -> Result<RpStat> {
Ok(RpStat::new(Metadata::new(EntryMode::Unknown)))
}

async fn read(&self, _: &str, _: OpRead) -> Result<(RpRead, Self::Reader)> {
Ok((RpRead::new(), Box::new(oio::Cursor::new())))
}
Expand All @@ -811,18 +815,6 @@ mod tests {
Ok((RpWrite::new(), Box::new(())))
}

async fn copy(&self, _: &str, _: &str, _: OpCopy) -> Result<RpCopy> {
Ok(RpCopy {})
}

async fn rename(&self, _: &str, _: &str, _: OpRename) -> Result<RpRename> {
Ok(RpRename {})
}

async fn stat(&self, _: &str, _: OpStat) -> Result<RpStat> {
Ok(RpStat::new(Metadata::new(EntryMode::Unknown)))
}

async fn delete(&self, _: &str, _: OpDelete) -> Result<RpDelete> {
Ok(RpDelete {})
}
Expand All @@ -831,6 +823,14 @@ mod tests {
Ok((RpList {}, Box::new(())))
}

async fn copy(&self, _: &str, _: &str, _: OpCopy) -> Result<RpCopy> {
Ok(RpCopy {})
}

async fn rename(&self, _: &str, _: &str, _: OpRename) -> Result<RpRename> {
Ok(RpRename {})
}

async fn presign(&self, _: &str, _: OpPresign) -> Result<RpPresign> {
Ok(RpPresign::new(PresignedRequest::new(
HttpMethod::POST,
Expand Down
4 changes: 2 additions & 2 deletions core/src/layers/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,10 +1164,10 @@ mod tests {
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl Accessor for MockService {
type Reader = MockReader;
type BlockingReader = ();
type Writer = ();
type BlockingWriter = ();
type Lister = MockLister;
type BlockingReader = ();
type BlockingWriter = ();
type BlockingLister = ();

fn info(&self) -> AccessorInfo {
Expand Down
4 changes: 2 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
//! every operation that OpenDAL performs.
//!
//! ```no_run
//! use opendal::layers::LoggingLayer;
//! use opendal::services;
//! use opendal::Operator;
//! use opendal::Result;
//! use opendal::layers::LoggingLayer;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
Expand Down Expand Up @@ -96,10 +96,10 @@
//! - `reader_with`: Create a reader with advanced options.
//!
//! ```no_run
//! use opendal::layers::LoggingLayer;
//! use opendal::services;
//! use opendal::Operator;
//! use opendal::Result;
//! use opendal::layers::LoggingLayer;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
Expand Down
Loading
Loading