Skip to content

Commit

Permalink
refactor: Bump MSRV to 1.64 (#1864)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo authored Apr 6, 2023
1 parent a41e33e commit a4cd52e
Show file tree
Hide file tree
Showing 23 changed files with 143 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
check_msrv:
runs-on: ubuntu-latest
env:
# OpenDAL's MSRV is 1.60.
OPENDAL_MSRV: "1.60"
# OpenDAL's MSRV is 1.64.
OPENDAL_MSRV: "1.64"
steps:
- uses: actions/checkout@v3
- name: Setup msrv of rust
Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ members = [

"bin/oli",
]

[workspace.package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
repository = "https://github.com/apache/incubator-opendal"
rust-version = "1.64"
version = "0.30.5"
21 changes: 14 additions & 7 deletions bin/oli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
categories = ["filesystem"]
description = "OpenDAL Command Line Interface"
edition = "2021"
homepage = "https://opendal.apache.org/"
keywords = ["storage", "data", "s3", "fs", "azblob"]
license = "Apache-2.0"
name = "oli"
repository = "https://github.com/apache/incubator-opendal"
version = "0.30.5"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[features]
# Enable services dashmap support
Expand Down Expand Up @@ -56,7 +58,12 @@ futures = "0.3"
log = "0.4"
opendal = { version = "0.30", path = "../../core" }
serde = { version = "1", features = ["derive"] }
tokio = { version = "1.27", features = ["fs", "macros", "rt-multi-thread", "io-std"] }
tokio = { version = "1.27", features = [
"fs",
"macros",
"rt-multi-thread",
"io-std",
] }
toml = "0.7.3"
url = "2.3.1"

Expand Down
7 changes: 5 additions & 2 deletions bin/oli/src/commands/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

use std::path::PathBuf;

use anyhow::{anyhow, Result};
use clap::{Arg, ArgMatches, Command};
use anyhow::anyhow;
use anyhow::Result;
use clap::Arg;
use clap::ArgMatches;
use clap::Command;
use tokio::io;

use crate::config::Config;
Expand Down
11 changes: 8 additions & 3 deletions bin/oli/src/commands/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
// specific language governing permissions and limitations
// under the License.

use std::path::{Path, PathBuf};
use std::path::Path;
use std::path::PathBuf;

use anyhow::{anyhow, Result};
use clap::{Arg, ArgAction, ArgMatches, Command};
use anyhow::anyhow;
use anyhow::Result;
use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use futures::TryStreamExt;
use opendal::Metakey;

Expand Down
8 changes: 6 additions & 2 deletions bin/oli/src/commands/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

use std::path::PathBuf;

use anyhow::{anyhow, Result};
use clap::{Arg, ArgAction, ArgMatches, Command};
use anyhow::anyhow;
use anyhow::Result;
use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use futures::TryStreamExt;

use crate::config::Config;
Expand Down
8 changes: 6 additions & 2 deletions bin/oli/src/commands/rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

use std::path::PathBuf;

use anyhow::{anyhow, Result};
use clap::{Arg, ArgAction, ArgMatches, Command};
use anyhow::anyhow;
use anyhow::Result;
use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;

use crate::config::Config;

Expand Down
7 changes: 5 additions & 2 deletions bin/oli/src/commands/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

use std::path::PathBuf;

use anyhow::{anyhow, Result};
use clap::{Arg, ArgMatches, Command};
use anyhow::anyhow;
use anyhow::Result;
use clap::Arg;
use clap::ArgMatches;
use clap::Command;

use crate::config::Config;

Expand Down
8 changes: 5 additions & 3 deletions bin/oli/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use std::borrow::Cow;
use std::collections::HashMap;
use std::env;
use std::fs;
use std::path::{Component, Path, PathBuf};
use std::path::Component;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;

use anyhow::anyhow;
Expand Down Expand Up @@ -76,7 +78,7 @@ impl Config {
let profiles = Config::load_from_env().profiles.into_iter().fold(
cfg.profiles,
|mut acc, (name, opts)| {
acc.entry(name).or_insert(HashMap::new()).extend(opts);
acc.entry(name).or_insert_with(HashMap::new).extend(opts);
acc
},
);
Expand Down Expand Up @@ -114,7 +116,7 @@ impl Config {
})
.fold(HashMap::new(), |mut acc, (profile_name, key, val)| {
acc.entry(profile_name)
.or_insert(HashMap::new())
.or_insert_with(HashMap::new)
.insert(key, val);
acc
});
Expand Down
12 changes: 7 additions & 5 deletions bindings/c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "opendal-c"
publish = false
repository = "https://github.com/apache/incubator-opendal"
version = "0.1.0"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
doc = false
Expand Down
9 changes: 7 additions & 2 deletions bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@

[package]
name = "opendal-java"
publish = false
version = "0.1.0"
edition = "2021"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
doc = false


[dependencies]
jni = "0.21.1"
opendal = { version = "0.30", path = "../../core" }
8 changes: 4 additions & 4 deletions bindings/java/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub unsafe extern "system" fn Java_org_apache_opendal_Operator_freeOperator(
_class: JClass,
ptr: *mut Operator,
) {
unsafe { Box::from_raw(ptr) };
let _ = Box::from_raw(ptr);
}

/// # Safety
Expand All @@ -102,7 +102,7 @@ pub unsafe extern "system" fn Java_org_apache_opendal_Operator_write(
file: JString,
content: JString,
) {
let op = unsafe { &mut *ptr };
let op = &mut *ptr;
let file: String = env
.get_string(&file)
.expect("Couldn't get java string!")
Expand All @@ -124,7 +124,7 @@ pub unsafe extern "system" fn Java_org_apache_opendal_Operator_read<'local>(
ptr: *mut BlockingOperator,
file: JString<'local>,
) -> JString<'local> {
let op = unsafe { &mut *ptr };
let op = &mut *ptr;
let file: String = env
.get_string(&file)
.expect("Couldn't get java string!")
Expand All @@ -147,7 +147,7 @@ pub unsafe extern "system" fn Java_org_apache_opendal_Operator_delete<'local>(
ptr: *mut BlockingOperator,
file: JString<'local>,
) {
let op = unsafe { &mut *ptr };
let op = &mut *ptr;
let file: String = env
.get_string(&file)
.expect("Couldn't get java string!")
Expand Down
14 changes: 8 additions & 6 deletions bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "opendal-nodejs"
publish = false
repository = "https://github.com/apache/incubator-opendal"
version = "0.30.5"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
15 changes: 8 additions & 7 deletions bindings/object_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
description = "OpenDAL's object_store binding"
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "object_store_opendal"
repository = "https://github.com/apache/incubator-opendal"
rust-version = "1.60" # MSRV for this project - please update while bump versions
version = "0.30.5"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
async-trait = "0.1"
Expand Down
14 changes: 8 additions & 6 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "opendal-python"
publish = false
repository = "https://github.com/apache/incubator-opendal"
version = "0.30.5"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ readme = "README.md"
requires-python = ">=3.7"

[project.optional-dependencies]
test = ["behave"]
docs = ["pdoc"]
test = ["behave"]

[project.urls]
Documentation = "https://docs.rs/opendal/"
Homepage = "https://opendal.apache.org/"
Repository = "https://github.com/apache/incubator-opendal"

[tool.maturin]
module-name = "opendal._opendal"
features = ["pyo3/extension-module"]
module-name = "opendal._opendal"
python-source = "python"
14 changes: 8 additions & 6 deletions bindings/ruby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@
# under the License.

[package]
authors = ["OpenDAL Contributors <dev@opendal.apache.org>"]
edition = "2021"
homepage = "https://opendal.apache.org/"
license = "Apache-2.0"
name = "opendal-ruby"
publish = false
repository = "https://github.com/apache/incubator-opendal"
version = "0.1.0"

authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
doc = false
name = "opendal_ruby"

[dependencies]
magnus = { version = "0.5", features = ["bytes-crate"] }
opendal = { version = "0.30", path = "../../core" }
magnus = { version = "0.5" , features = ["bytes-crate"] }
Loading

0 comments on commit a4cd52e

Please sign in to comment.