Skip to content

Commit 2bc11f8

Browse files
committed
Remove log! and error! macros
1 parent a00354d commit 2bc11f8

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

src/shortcuts.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// @TODO merge with `pub use` & `prelude` in `lib.rs` and `browser::util`?
55

66
use crate::virtual_dom::{At, Attrs};
7-
use std::fmt;
87

98
/// Allows to write nested macros.
109
///
@@ -488,54 +487,6 @@ macro_rules! nodes {
488487
};
489488
}
490489

491-
pub const fn wrap_debug<T>(object: T) -> T
492-
where
493-
T: fmt::Debug,
494-
{
495-
object
496-
}
497-
498-
/// A convenience function for logging to the web browser's console. We use
499-
/// a macro to supplement the log function to allow multiple inputs.
500-
#[macro_export]
501-
#[deprecated(note = "Use something like https://crates.io/crates/gloo-console instead")]
502-
macro_rules! log {
503-
{ $($expr:expr),* $(,)? } => {
504-
{
505-
let mut formatted_exprs = Vec::new();
506-
$(
507-
formatted_exprs.push(format!("{:#?}", $crate::shortcuts::wrap_debug(&$expr)));
508-
)*
509-
$crate::shortcuts::log_1(
510-
&formatted_exprs
511-
.as_slice()
512-
.join(" ")
513-
.into()
514-
);
515-
}
516-
};
517-
}
518-
519-
/// Similar to log!
520-
#[macro_export]
521-
#[deprecated(note = "Use something like https://crates.io/crates/gloo-console instead")]
522-
macro_rules! error {
523-
{ $($expr:expr),* $(,)? } => {
524-
{
525-
let mut formatted_exprs = Vec::new();
526-
$(
527-
formatted_exprs.push(format!("{:#?}", $crate::shortcuts::wrap_debug(&$expr)));
528-
)*
529-
web_sys::console::error_1(
530-
&formatted_exprs
531-
.as_slice()
532-
.join(" ")
533-
.into()
534-
);
535-
}
536-
};
537-
}
538-
539490
/// A key-value pairs, where the keys and values must implement `ToString`.
540491
#[macro_export]
541492
macro_rules! key_value_pairs {

src/virtual_dom/node/el.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ impl<Ms> El<Ms> {
277277
_ => false,
278278
};
279279
if script_found {
280-
error!("Script tag found inside mount point! \
281-
Please check https://docs.rs/seed/latest/seed/app/builder/struct.Builder.html#examples");
280+
web_sys::console::error_1(&wasm_bindgen::JsValue::from("Script tag found inside mount point! \
281+
Please check https://docs.rs/seed/latest/seed/app/builder/struct.Builder.html#examples"));
282282
}
283283

284284
for child in &self.children {

0 commit comments

Comments
 (0)