mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
remove std::fmt::debug
This commit is contained in:
parent
9b15201b25
commit
dfa91d5bb4
3 changed files with 25 additions and 14 deletions
|
@ -1,3 +1,4 @@
|
|||
use js_sys::Error;
|
||||
use thiserror::Error;
|
||||
use wasm_bindgen::{JsError, JsValue};
|
||||
|
||||
|
@ -20,7 +21,7 @@ pub enum RewriterError {
|
|||
|
||||
impl From<JsValue> for RewriterError {
|
||||
fn from(value: JsValue) -> Self {
|
||||
Self::Js(format!("{:?}", value))
|
||||
Self::Js(Error::from(value).to_string().into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,16 +32,16 @@ impl From<RewriterError> for JsValue {
|
|||
}
|
||||
|
||||
impl RewriterError {
|
||||
pub fn not_str(x: &str, obj: &JsValue) -> Self {
|
||||
Self::Not(format!("{:?} in {:?}", x, obj), "string")
|
||||
pub fn not_str(x: &str) -> Self {
|
||||
Self::Not(x.to_string(), "string")
|
||||
}
|
||||
|
||||
pub fn not_fn(obj: JsValue) -> Self {
|
||||
Self::Not(format!("{:?}", obj), "function")
|
||||
pub fn not_fn(x: &str) -> Self {
|
||||
Self::Not(x.to_string(), "function")
|
||||
}
|
||||
|
||||
pub fn not_bool(obj: &JsValue) -> Self {
|
||||
Self::Not(format!("{:?}", obj), "bool")
|
||||
pub fn not_bool(x: &str) -> Self {
|
||||
Self::Not(x.to_string(), "bool")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue