Fix up is binary & sync_lib docs & tests
This commit is contained in:
parent
825d398dec
commit
44cb7a5b7c
7 changed files with 80 additions and 42 deletions
|
|
@ -1,5 +1,3 @@
|
|||
use std::str::Utf8Error;
|
||||
|
||||
use base64::DecodeError;
|
||||
use thiserror::Error;
|
||||
use wasm_bindgen::JsValue;
|
||||
|
|
@ -8,9 +6,6 @@ use wasm_bindgen::JsValue;
|
|||
pub enum SyncLibError {
|
||||
#[error("Base64 decoding error because of {}", .reason)]
|
||||
Base64DecodingError { reason: String },
|
||||
|
||||
#[error("Bytes cannot be decoded as UTF-8 string because of {}", .reason)]
|
||||
StringDecodingError { reason: String },
|
||||
}
|
||||
|
||||
impl From<DecodeError> for SyncLibError {
|
||||
|
|
@ -21,14 +16,6 @@ impl From<DecodeError> for SyncLibError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Utf8Error> for SyncLibError {
|
||||
fn from(e: Utf8Error) -> Self {
|
||||
SyncLibError::StringDecodingError {
|
||||
reason: e.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::string::FromUtf8Error> for SyncLibError {
|
||||
fn from(e: std::string::FromUtf8Error) -> Self {
|
||||
SyncLibError::Base64DecodingError {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue