Update formatting
This commit is contained in:
parent
dda356ea00
commit
49638e5aa7
27 changed files with 239 additions and 232 deletions
|
|
@ -3,13 +3,9 @@ use errors::SyncLibError;
|
|||
|
||||
pub mod errors;
|
||||
|
||||
pub fn bytes_to_base64(input: &[u8]) -> String {
|
||||
STANDARD_NO_PAD.encode(input)
|
||||
}
|
||||
pub fn bytes_to_base64(input: &[u8]) -> String { STANDARD_NO_PAD.encode(input) }
|
||||
|
||||
pub fn string_to_base64(input: &str) -> String {
|
||||
bytes_to_base64(input.as_bytes())
|
||||
}
|
||||
pub fn string_to_base64(input: &str) -> String { bytes_to_base64(input.as_bytes()) }
|
||||
|
||||
pub fn base64_to_bytes(input: &str) -> Result<Vec<u8>, SyncLibError> {
|
||||
STANDARD_NO_PAD.decode(input).map_err(SyncLibError::from)
|
||||
|
|
@ -20,6 +16,4 @@ pub fn base64_to_string(input: &str) -> Result<String, SyncLibError> {
|
|||
String::from_utf8(bytes).map_err(SyncLibError::from)
|
||||
}
|
||||
|
||||
pub fn is_binary(data: &[u8]) -> bool {
|
||||
data.iter().any(|&b| b == 0)
|
||||
}
|
||||
pub fn is_binary(data: &[u8]) -> bool { data.iter().any(|&b| b == 0) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue