From 1d98890964c1f118620d4f3447a97c4db85a7313 Mon Sep 17 00:00:00 2001 From: kingzcheung Date: Wed, 21 Jun 2023 11:31:40 +0800 Subject: [PATCH] 1. update readme 2. cleanup unused code --- Cargo.toml | 2 +- README.md | 11 +++++++++++ src/error.rs | 1 - src/object.rs | 2 -- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f9f8b77..7df1d45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "huaweicloud-sdk-rust-obs" description = "huaweicloud obs rust sdk" authors = ["KingzCheung "] -version = "0.2.0" +version = "0.2.1" edition = "2021" readme = "README.md" license-file = "LICENSE-APACHE-2.0" diff --git a/README.md b/README.md index 560bb5d..d50fb7f 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,14 @@ async fn main() -> Result<(), ObsError> { } ``` +## 测试 + +1. 在项目根目录添加 `.env`文件,内容格式如下: + +``` +OBS_AK=XXXXXXXXXXXXXXX +OBS_SK=XXXXXXXXXXXXXXXXXXXX +``` + +2. `tests/common/mod.rs` 下的 `DEFAULT_BUCKET_NAME` 替换为自己的 bucket 名称 +3. 运行 `cargo test` \ No newline at end of file diff --git a/src/error.rs b/src/error.rs index 8254823..8912a88 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,5 @@ use reqwest::{StatusCode}; use serde::Deserialize; -use serde_json::error; use thiserror::Error; use crate::model::ErrorResponse; diff --git a/src/object.rs b/src/object.rs index ef92ff1..13f4842 100644 --- a/src/object.rs +++ b/src/object.rs @@ -121,8 +121,6 @@ impl ObjectTrait for Client { .await?; let status = resp.status(); let headers = resp.headers().clone(); - let text = resp.text().await; - dbg!(text); if status.is_success() { let next_position = if let Some(next) = headers.get("x-obs-next-append-position") {