Skip to content

Commit

Permalink
fix cargo clippy,upgrade version to v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
heqingpan committed Oct 7, 2024
1 parent 77ba4d8 commit 179d614
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rnacos"
version = "0.6.0-beta"
version = "0.6.0"
authors = ["heqingpan <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down Expand Up @@ -71,7 +71,7 @@ mime_guess = { version = "2" }
rusqlite = { version = "0.25", features = ["bundled"] }
rsql_builder = "0.1.5"
inner-mem-cache = "0.1.7"
rnacos-web-dist-wrap = "=0.3.22-beta"
rnacos-web-dist-wrap = "=0.5.0"
nacos_rust_client = "0.2"
zip = "0.6"
tempfile = "3"
Expand Down
2 changes: 1 addition & 1 deletion src/common/constant.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

pub const APP_VERSION: &str = "0.6.0-beta";
pub const APP_VERSION: &str = "0.6.0";

pub const EMPTY_STR: &str = "";

Expand Down
8 changes: 4 additions & 4 deletions src/console/login_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ pub async fn gen_captcha(app: Data<Arc<AppShareData>>) -> actix_web::Result<impl

// 如果验证码功能被禁用,data 为 null
if !app.sys_config.console_captcha_enable {
return Ok(HttpResponse::Ok()
.cookie(captcha_cookie)
.insert_header(captcha_header)
.json(ApiResult::<String>::success(None)));
return Ok(HttpResponse::Ok()
.cookie(captcha_cookie)
.insert_header(captcha_header)
.json(ApiResult::<String>::success(None)));
}

//let obj = gen(Difficulty::Easy);
Expand Down
4 changes: 2 additions & 2 deletions src/console/transfer_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::common::appdata::AppShareData;
use crate::console::config_api::UploadForm;
use crate::now_millis;
use crate::transfer::model::{
TransferBackupParam, TransferImportParam, TransferImportResponse,
TransferManagerAsyncRequest, TransferManagerResponse,
TransferBackupParam, TransferImportParam, TransferImportResponse, TransferManagerAsyncRequest,
TransferManagerResponse,
};
use actix_multipart::form::MultipartForm;
use actix_web::http::header;
Expand Down
6 changes: 2 additions & 4 deletions src/namespace/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pub mod model;

use crate::common::constant::{
EMPTY_ARC_STRING, NAMESPACE_TREE_NAME,
};
use crate::common::constant::{EMPTY_ARC_STRING, NAMESPACE_TREE_NAME};
use crate::common::string_utils::StringUtils;
use crate::config::core::ConfigActor;
use crate::console::NamespaceUtilsOld;
Expand Down Expand Up @@ -110,7 +108,7 @@ impl NamespaceActor {
if only_add {
return;
}
let mut value = Namespace{
let mut value = Namespace {
namespace_id: param.namespace_id,
..Namespace::default()
};
Expand Down
25 changes: 12 additions & 13 deletions src/transfer/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ impl ConfigCacheSequence {
if let Some(next_id) = self.seq.next_id() {
Ok((next_id, None))
} else if let ConfigResult::SequenceSection { start, end } = self
.config
.send(ConfigCmd::GetSequenceSection(100))
.await??
{
self.seq = CacheSequence::new(start + 1, end - start);
Ok((start, Some(end)))
} else {
Err(anyhow::anyhow!("config result is error"))
}

.config
.send(ConfigCmd::GetSequenceSection(100))
.await??
{
self.seq = CacheSequence::new(start + 1, end - start);
Ok((start, Some(end)))
} else {
Err(anyhow::anyhow!("config result is error"))
}
}
}

Expand All @@ -127,7 +126,6 @@ impl Default for TransferImportManager {
}
}


impl TransferImportManager {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -155,8 +153,9 @@ impl TransferImportManager {
} else if param.config && record.table_name.as_str() == NAMESPACE_TREE_NAME.as_str()
{
Self::apply_namespace(raft, record).await?;
} else if ( param.user && record.table_name.as_str() == USER_TREE_NAME.as_str() ) ||
(param.cache && record.table_name.as_str() == CACHE_TREE_NAME.as_str()) {
} else if (param.user && record.table_name.as_str() == USER_TREE_NAME.as_str())
|| (param.cache && record.table_name.as_str() == CACHE_TREE_NAME.as_str())
{
Self::apply_table(raft, record).await?;
} else {
ignore += 1;
Expand Down

0 comments on commit 179d614

Please sign in to comment.