mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 07:57:01 +00:00
fix clippy
This commit is contained in:
@@ -445,12 +445,8 @@ impl Event {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut resp_elements = args.resp_elements.clone();
|
let mut resp_elements = args.resp_elements.clone();
|
||||||
resp_elements
|
resp_elements.entry("x-amz-request-id".to_string()).or_default();
|
||||||
.entry("x-amz-request-id".to_string())
|
resp_elements.entry("x-amz-id-2".to_string()).or_default();
|
||||||
.or_insert_with(|| "".to_string());
|
|
||||||
resp_elements
|
|
||||||
.entry("x-amz-id-2".to_string())
|
|
||||||
.or_insert_with(|| "".to_string());
|
|
||||||
// ... Filling of other response elements
|
// ... Filling of other response elements
|
||||||
|
|
||||||
// URL encoding of object keys
|
// URL encoding of object keys
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ impl Notifier {
|
|||||||
// Create an event and send it
|
// Create an event and send it
|
||||||
let event = Event::new(args.clone());
|
let event = Event::new(args.clone());
|
||||||
notification_sys
|
notification_sys
|
||||||
.send_event(&args.bucket_name, &args.event_name.as_str(), &args.object.name.clone(), event)
|
.send_event(&args.bucket_name, args.event_name.as_str(), args.object.name.as_str(), event)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,10 +189,7 @@ impl NotificationSystem {
|
|||||||
info!("Attempting to remove target: {}", target_id);
|
info!("Attempting to remove target: {}", target_id);
|
||||||
|
|
||||||
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
||||||
return Err(NotificationError::Io(std::io::Error::new(
|
return Err(NotificationError::Io(std::io::Error::other("errServerNotInitialized")));
|
||||||
std::io::ErrorKind::Other,
|
|
||||||
"errServerNotInitialized",
|
|
||||||
)));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut new_config = ecstore::config::com::read_config_without_migrate(store.clone())
|
let mut new_config = ecstore::config::com::read_config_without_migrate(store.clone())
|
||||||
@@ -243,10 +240,7 @@ impl NotificationSystem {
|
|||||||
info!("Setting config for target {} of type {}", target_name, target_type);
|
info!("Setting config for target {} of type {}", target_name, target_type);
|
||||||
// 1. Get the storage handle
|
// 1. Get the storage handle
|
||||||
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
||||||
return Err(NotificationError::Io(std::io::Error::new(
|
return Err(NotificationError::Io(std::io::Error::other("errServerNotInitialized")));
|
||||||
std::io::ErrorKind::Other,
|
|
||||||
"errServerNotInitialized",
|
|
||||||
)));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 2. Read the latest configuration from storage
|
// 2. Read the latest configuration from storage
|
||||||
@@ -306,10 +300,7 @@ impl NotificationSystem {
|
|||||||
pub async fn remove_target_config(&self, target_type: &str, target_name: &str) -> Result<(), NotificationError> {
|
pub async fn remove_target_config(&self, target_type: &str, target_name: &str) -> Result<(), NotificationError> {
|
||||||
info!("Removing config for target {} of type {}", target_name, target_type);
|
info!("Removing config for target {} of type {}", target_name, target_type);
|
||||||
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
let Some(store) = ecstore::global::new_object_layer_fn() else {
|
||||||
return Err(NotificationError::Io(std::io::Error::new(
|
return Err(NotificationError::Io(std::io::Error::other("errServerNotInitialized")));
|
||||||
std::io::ErrorKind::Other,
|
|
||||||
"errServerNotInitialized",
|
|
||||||
)));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut new_config = ecstore::config::com::read_config_without_migrate(store.clone())
|
let mut new_config = ecstore::config::com::read_config_without_migrate(store.clone())
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ impl UserAgent {
|
|||||||
fn get_macos_platform(_sys: &System) -> String {
|
fn get_macos_platform(_sys: &System) -> String {
|
||||||
let binding = System::os_version().unwrap_or("14.5.0".to_string());
|
let binding = System::os_version().unwrap_or("14.5.0".to_string());
|
||||||
let version = binding.split('.').collect::<Vec<&str>>();
|
let version = binding.split('.').collect::<Vec<&str>>();
|
||||||
let major = version.get(0).unwrap_or(&"14").to_string();
|
let major = version.first().unwrap_or(&"14").to_string();
|
||||||
let minor = version.get(1).unwrap_or(&"5").to_string();
|
let minor = version.get(1).unwrap_or(&"5").to_string();
|
||||||
let patch = version.get(2).unwrap_or(&"0").to_string();
|
let patch = version.get(2).unwrap_or(&"0").to_string();
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -502,11 +502,9 @@ async fn run(opt: config::Opt) -> Result<()> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// init store
|
// init store
|
||||||
let store = ECStore::new(server_addr.clone(), endpoint_pools.clone())
|
let store = ECStore::new(server_addr, endpoint_pools.clone()).await.inspect_err(|err| {
|
||||||
.await
|
error!("ECStore::new {:?}", err);
|
||||||
.inspect_err(|err| {
|
})?;
|
||||||
error!("ECStore::new {:?}", err);
|
|
||||||
})?;
|
|
||||||
|
|
||||||
ecconfig::init();
|
ecconfig::init();
|
||||||
// config system configuration
|
// config system configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user