This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch async-presign
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/async-presign by this push:
new 5e12ef01 Fix unit test
5e12ef01 is described below
commit 5e12ef01f0fc44f96bcb66ac4f2687e8f7d10fbc
Author: Xuanwo <[email protected]>
AuthorDate: Tue Apr 11 08:32:52 2023 +0800
Fix unit test
Signed-off-by: Xuanwo <[email protected]>
---
bindings/c/src/lib.rs | 8 +++++---
bindings/c/src/result.rs | 3 ++-
core/src/types/operator/operator.rs | 10 +++++-----
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/bindings/c/src/lib.rs b/bindings/c/src/lib.rs
index 943e4fa0..c248502e 100644
--- a/bindings/c/src/lib.rs
+++ b/bindings/c/src/lib.rs
@@ -26,11 +26,13 @@ use std::collections::HashMap;
use std::os::raw::c_char;
use std::str::FromStr;
-use crate::types::{opendal_bytes, opendal_operator_ptr};
-
use ::opendal as od;
use error::opendal_code;
-use result::{opendal_result_is_exist, opendal_result_read};
+use result::opendal_result_is_exist;
+use result::opendal_result_read;
+
+use crate::types::opendal_bytes;
+use crate::types::opendal_operator_ptr;
/// Returns a result type [`opendal_result_op`], with operator_ptr. If the
construction succeeds
/// the error is nullptr, otherwise it contains the error information.
diff --git a/bindings/c/src/result.rs b/bindings/c/src/result.rs
index 69b2c5ba..6f869973 100644
--- a/bindings/c/src/result.rs
+++ b/bindings/c/src/result.rs
@@ -20,7 +20,8 @@
//! "opendal_result_opendal_operator_ptr", which is unacceptable. Therefore,
//! we are defining all Result types here
-use crate::{error::opendal_code, types::opendal_bytes};
+use crate::error::opendal_code;
+use crate::types::opendal_bytes;
/// The Rust-like Result type of opendal C binding, it contains
/// the data that the read operation returns and a error code
diff --git a/core/src/types/operator/operator.rs
b/core/src/types/operator/operator.rs
index ac1dbcf8..2b1526e2 100644
--- a/core/src/types/operator/operator.rs
+++ b/core/src/types/operator/operator.rs
@@ -1065,7 +1065,7 @@ impl Operator {
///
/// #[tokio::main]
/// async fn test(op: Operator) -> Result<()> {
- /// let signed_req = op.presign_stat("test",Duration::hours(1))?;
+ /// let signed_req = op.presign_stat("test",Duration::hours(1)).await?;
/// let req = http::Request::builder()
/// .method(signed_req.method())
/// .uri(signed_req.uri())
@@ -1095,7 +1095,7 @@ impl Operator {
///
/// #[tokio::main]
/// async fn test(op: Operator) -> Result<()> {
- /// let signed_req = op.presign_read("test.txt", Duration::hours(1))?;
+ /// let signed_req = op.presign_read("test.txt",
Duration::hours(1)).await?;
/// # Ok(())
/// # }
/// ```
@@ -1135,7 +1135,7 @@ impl Operator {
/// async fn test(op: Operator) -> Result<()> {
/// let args = OpRead::new()
/// .with_override_content_disposition("attachment;
filename=\"othertext.txt\"");
- /// let signed_req = op.presign_read_with("test.txt", args,
Duration::hours(1))?;
+ /// let signed_req = op.presign_read_with("test.txt", args,
Duration::hours(1)).await?;
/// # Ok(())
/// # }
/// ```
@@ -1165,7 +1165,7 @@ impl Operator {
///
/// #[tokio::main]
/// async fn test(op: Operator) -> Result<()> {
- /// let signed_req = op.presign_write("test.txt", Duration::hours(1))?;
+ /// let signed_req = op.presign_write("test.txt",
Duration::hours(1)).await?;
/// # Ok(())
/// # }
/// ```
@@ -1199,7 +1199,7 @@ impl Operator {
/// #[tokio::main]
/// async fn test(op: Operator) -> Result<()> {
/// let args = OpWrite::new().with_content_type("text/csv");
- /// let signed_req = op.presign_write_with("test", args,
Duration::hours(1))?;
+ /// let signed_req = op.presign_write_with("test", args,
Duration::hours(1)).await?;
/// let req = http::Request::builder()
/// .method(signed_req.method())
/// .uri(signed_req.uri())