mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
cargo fmt
This commit is contained in:
@@ -929,13 +929,17 @@ impl FileMetaVersion {
|
||||
}
|
||||
|
||||
pub fn get_data_dir(&self) -> Option<Uuid> {
|
||||
if self.valid() { {
|
||||
if self.valid() {
|
||||
{
|
||||
if self.version_type == VersionType::Object {
|
||||
self.object.as_ref().map(|v| v.data_dir).unwrap_or_default()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} } else { Default::default() }
|
||||
}
|
||||
} else {
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_version_id(&self) -> Option<Uuid> {
|
||||
|
||||
@@ -241,8 +241,7 @@ impl MQTTTarget {
|
||||
records: vec![event.clone()],
|
||||
};
|
||||
|
||||
let data =
|
||||
serde_json::to_vec(&log).map_err(|e| TargetError::Serialization(format!("Failed to serialize event: {e}")))?;
|
||||
let data = serde_json::to_vec(&log).map_err(|e| TargetError::Serialization(format!("Failed to serialize event: {e}")))?;
|
||||
|
||||
// Vec<u8> Convert to String, only for printing logs
|
||||
let data_string = String::from_utf8(data.clone())
|
||||
|
||||
@@ -206,8 +206,7 @@ impl WebhookTarget {
|
||||
records: vec![event.clone()],
|
||||
};
|
||||
|
||||
let data =
|
||||
serde_json::to_vec(&log).map_err(|e| TargetError::Serialization(format!("Failed to serialize event: {e}")))?;
|
||||
let data = serde_json::to_vec(&log).map_err(|e| TargetError::Serialization(format!("Failed to serialize event: {e}")))?;
|
||||
|
||||
// Vec<u8> Convert to String
|
||||
let data_string = String::from_utf8(data.clone())
|
||||
|
||||
@@ -333,9 +333,7 @@ pub(crate) fn init_telemetry(config: &OtelConfig) -> OtelGuard {
|
||||
// Configure the flexi_logger
|
||||
let flexi_logger_result = flexi_logger::Logger::try_with_env_or_str(logger_level)
|
||||
.unwrap_or_else(|e| {
|
||||
eprintln!(
|
||||
"Invalid logger level: {logger_level}, using default: {DEFAULT_LOG_LEVEL}, failed error: {e:?}"
|
||||
);
|
||||
eprintln!("Invalid logger level: {logger_level}, using default: {DEFAULT_LOG_LEVEL}, failed error: {e:?}");
|
||||
flexi_logger::Logger::with(log_spec.clone())
|
||||
})
|
||||
.log_to_file(
|
||||
|
||||
@@ -484,9 +484,7 @@ mod tests {
|
||||
}
|
||||
|
||||
// 验证 etag(注意:压缩会改变数据,所以这里的 etag 验证可能需要调整)
|
||||
println!(
|
||||
"Test completed successfully with compression: {is_compress}, encryption: {is_encrypt}"
|
||||
);
|
||||
println!("Test completed successfully with compression: {is_compress}, encryption: {is_encrypt}");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -22,9 +22,7 @@ pub fn load_certs(filename: &str) -> io::Result<Vec<CertificateDer<'static>>> {
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.map_err(|e| certs_error(format!("certificate file {filename} format error:{e:?}")))?;
|
||||
if certs.is_empty() {
|
||||
return Err(certs_error(format!(
|
||||
"No valid certificate was found in the certificate file {filename}"
|
||||
)));
|
||||
return Err(certs_error(format!("No valid certificate was found in the certificate file {filename}")));
|
||||
}
|
||||
Ok(certs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user