Skip to content

Commit

Permalink
- Remove deprecated feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleG committed Nov 7, 2024
1 parent 426a0bf commit fbfbf24
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
18 changes: 1 addition & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,10 @@ edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["console_error_panic_hook"]

[dependencies]
diff-match-patch-rs = "0.3.0"
serde-wasm-bindgen = "0.6.5"
wasm-bindgen = { version = "0.2.95", features = ["serde-serialize"] }

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.7", optional = true }

# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
# compared to the default allocator's ~10K. It is slower than the default
# allocator, however.
#
# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now.
wee_alloc = { version = "0.4.5", optional = true }
wasm-bindgen = "0.2.95"

[dev-dependencies]
wasm-bindgen-test = "0.3.45"
Expand Down
8 changes: 0 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
mod utils;
use diff_match_patch_rs::{Efficient, Ops, dmp::DiffMatchPatch};
use serde_wasm_bindgen::to_value;
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};

// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

#[wasm_bindgen]
#[derive(Default)]
pub struct Differ {
Expand All @@ -19,7 +12,6 @@ pub struct Differ {
impl Differ {
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
utils::set_panic_hook();
let dmp = DiffMatchPatch::default();
Self { dmp }
}
Expand Down
10 changes: 0 additions & 10 deletions src/utils.rs

This file was deleted.

0 comments on commit fbfbf24

Please sign in to comment.