mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
fix: 优化警告代码
This commit is contained in:
@@ -10,13 +10,13 @@ pub fn hex(data: impl AsRef<[u8]>) -> String {
|
||||
hex_simd::encode_to_string(data, hex_simd::AsciiCase::Lower)
|
||||
}
|
||||
|
||||
#[cfg(not(all(feature = "openssl", not(windows))))]
|
||||
#[cfg(windows)]
|
||||
pub fn sha256(data: &[u8]) -> impl AsRef<[u8; 32]> {
|
||||
use sha2::{Digest, Sha256};
|
||||
<Sha256 as Digest>::digest(data)
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "openssl", not(windows)))]
|
||||
#[cfg(not(windows))]
|
||||
pub fn sha256(data: &[u8]) -> impl AsRef<[u8]> {
|
||||
use openssl::hash::{Hasher, MessageDigest};
|
||||
let mut h = Hasher::new(MessageDigest::sha256()).unwrap();
|
||||
|
||||
@@ -18,6 +18,7 @@ pub fn encode_dir_object(object: &str) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn decode_dir_object(object: &str) -> String {
|
||||
if has_suffix(object, GLOBAL_DIR_SUFFIX) {
|
||||
format!("{}{}", object.trim_end_matches(GLOBAL_DIR_SUFFIX), SLASH_SEPARATOR)
|
||||
|
||||
Reference in New Issue
Block a user