fix: api doesn't really require woot or similar

This commit is contained in:
əlemi 2024-02-09 01:04:10 +01:00
parent f706237828
commit 4fdd2a79c4
2 changed files with 2 additions and 1 deletions

View file

@ -32,7 +32,7 @@ tonic-build = "0.9"
[features]
default = []
api = ["woot", "dep:tokio", "dep:async-trait"]
api = ["dep:async-trait"]
woot = ["dep:codemp-woot", "dep:similar"]
proto = ["dep:prost", "dep:tonic", "dep:uuid"]
client = ["proto", "api", "dep:tokio", "dep:tokio-stream", "dep:uuid", "dep:md5", "dep:serde_json", "dep:dashmap", "dep:postcard"]

View file

@ -30,6 +30,7 @@ pub struct TextChange {
}
impl TextChange {
#[cfg(feature = "woot")]
/// create a new TextChange from the difference of given strings
pub fn from_diff(before: &str, after: &str) -> TextChange {
let diff = similar::TextDiff::from_chars(before, after);