You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/03/24 15:00:26 UTC

[incubator-opendal] 01/02: Format code

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch cleanup
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit 53afc08bfb000b8a44ab2d7a3240c43e179cbc09
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Fri Mar 24 22:56:40 2023 +0800

    Format code
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 Cargo.lock                          |  2 +-
 bin/oli/src/bin/oli.rs              |  7 +++++--
 bin/oli/src/commands/cli.rs         |  3 ++-
 bin/oli/src/config/mod.rs           | 10 +++++++---
 bindings/java/src/lib.rs            |  9 ++++++---
 bindings/ruby/Cargo.toml            |  4 ++--
 bindings/ruby/src/lib.rs            | 17 ++++++++++++-----
 core/src/types/operator/operator.rs |  8 ++++----
 8 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 6490b858..65bb36fa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2288,7 +2288,7 @@ dependencies = [
 ]
 
 [[package]]
-name = "opendal_ruby"
+name = "opendal-ruby"
 version = "0.1.0"
 dependencies = [
  "magnus",
diff --git a/bin/oli/src/bin/oli.rs b/bin/oli/src/bin/oli.rs
index 92e073f7..62876570 100644
--- a/bin/oli/src/bin/oli.rs
+++ b/bin/oli/src/bin/oli.rs
@@ -26,8 +26,11 @@ use std::env;
 use std::ffi::OsStr;
 use std::path::PathBuf;
 
-use anyhow::{anyhow, Result};
-use clap::{value_parser, Arg, Command};
+use anyhow::anyhow;
+use anyhow::Result;
+use clap::value_parser;
+use clap::Arg;
+use clap::Command;
 use dirs::config_dir;
 
 fn new_cmd(name: &'static str) -> Result<Command> {
diff --git a/bin/oli/src/commands/cli.rs b/bin/oli/src/commands/cli.rs
index 4c15fb6a..645cfdbe 100644
--- a/bin/oli/src/commands/cli.rs
+++ b/bin/oli/src/commands/cli.rs
@@ -17,7 +17,8 @@
 
 use anyhow::anyhow;
 use anyhow::Result;
-use clap::{ArgMatches, Command};
+use clap::ArgMatches;
+use clap::Command;
 
 pub async fn main(args: &ArgMatches) -> Result<()> {
     match args.subcommand() {
diff --git a/bin/oli/src/config/mod.rs b/bin/oli/src/config/mod.rs
index 8b5c6efe..060a4b57 100644
--- a/bin/oli/src/config/mod.rs
+++ b/bin/oli/src/config/mod.rs
@@ -21,8 +21,11 @@ use std::fs;
 use std::path::Path;
 use std::str::FromStr;
 
-use anyhow::{anyhow, Result};
-use opendal::{services, Operator, Scheme};
+use anyhow::anyhow;
+use anyhow::Result;
+use opendal::services;
+use opendal::Operator;
+use opendal::Scheme;
 use serde::Deserialize;
 use toml;
 
@@ -213,9 +216,10 @@ impl Config {
 
 #[cfg(test)]
 mod tests {
-    use super::*;
     use opendal::Scheme;
 
+    use super::*;
+
     #[test]
     fn test_load_from_env() {
         let env_vars = vec![
diff --git a/bindings/java/src/lib.rs b/bindings/java/src/lib.rs
index 32c537d2..370017bb 100644
--- a/bindings/java/src/lib.rs
+++ b/bindings/java/src/lib.rs
@@ -18,11 +18,14 @@
 use std::collections::HashMap;
 use std::str::FromStr;
 
-use jni::objects::{JClass, JMap, JObject, JString};
+use jni::objects::JClass;
+use jni::objects::JMap;
+use jni::objects::JObject;
+use jni::objects::JString;
 use jni::JNIEnv;
-
+use opendal::BlockingOperator;
+use opendal::Operator;
 use opendal::Scheme;
-use opendal::{BlockingOperator, Operator};
 
 #[no_mangle]
 pub extern "system" fn Java_org_apache_opendal_Operator_getOperator(
diff --git a/bindings/ruby/Cargo.toml b/bindings/ruby/Cargo.toml
index 99f3b677..55d2d79c 100644
--- a/bindings/ruby/Cargo.toml
+++ b/bindings/ruby/Cargo.toml
@@ -20,7 +20,7 @@ authors = ["OpenDAL Contributors <de...@opendal.apache.org>"]
 edition = "2021"
 homepage = "https://opendal.apache.org/"
 license = "Apache-2.0"
-name = "opendal_ruby"
+name = "opendal-ruby"
 publish = false
 repository = "https://github.com/apache/incubator-opendal"
 version = "0.1.0"
@@ -32,4 +32,4 @@ name = "opendal_ruby"
 
 [dependencies]
 opendal = { version = "0.30", path = "../../core" }
-magnus = { version = "0.5" , features = ["bytes-crate"] }
\ No newline at end of file
+magnus = { version = "0.5" , features = ["bytes-crate"] }
diff --git a/bindings/ruby/src/lib.rs b/bindings/ruby/src/lib.rs
index 8e5fc7a2..3a3c404d 100644
--- a/bindings/ruby/src/lib.rs
+++ b/bindings/ruby/src/lib.rs
@@ -15,11 +15,18 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use std::{collections::HashMap, str::FromStr};
-
-use magnus::{
-    class, define_module, error::Result, exception, function, method, prelude::*, Error, RString,
-};
+use std::collections::HashMap;
+use std::str::FromStr;
+
+use magnus::class;
+use magnus::define_module;
+use magnus::error::Result;
+use magnus::exception;
+use magnus::function;
+use magnus::method;
+use magnus::prelude::*;
+use magnus::Error;
+use magnus::RString;
 use opendal as od;
 
 fn build_operator(scheme: od::Scheme, map: HashMap<String, String>) -> Result<od::Operator> {
diff --git a/core/src/types/operator/operator.rs b/core/src/types/operator/operator.rs
index 21b74bf7..9ede09f4 100644
--- a/core/src/types/operator/operator.rs
+++ b/core/src/types/operator/operator.rs
@@ -790,10 +790,10 @@ impl Operator {
     /// ```no_run
     /// # use anyhow::Result;
     /// # use futures::io;
-    /// use opendal::Operator;
-    /// use opendal::EntryMode;
     /// use futures::TryStreamExt;
+    /// use opendal::EntryMode;
     /// use opendal::Metakey;
+    /// use opendal::Operator;
     /// # #[tokio::main]
     /// # async fn test(op: Operator) -> Result<()> {
     /// let mut ds = op.list("path/to/dir/").await?;
@@ -841,10 +841,10 @@ impl Operator {
     /// ```no_run
     /// # use anyhow::Result;
     /// # use futures::io;
-    /// use opendal::Operator;
-    /// use opendal::EntryMode;
     /// use futures::TryStreamExt;
+    /// use opendal::EntryMode;
     /// use opendal::Metakey;
+    /// use opendal::Operator;
     /// #
     /// # #[tokio::main]
     /// # async fn test(op: Operator) -> Result<()> {