Cargo Features

[dependencies]
similar = { version = "2.4.0", default-features = false, features = ["text", "inline", "unicode", "bytes", "serde"] }
default = text

The text feature is set by default whenever similar is added without default-features = false somewhere in the dependency tree.

text default bytes? inline? unicode?

Affects similar::udiff, similar::utils

inline = text
unicode = text, unicode-segmentation

this annoyingly currently also turns on bstr and not just bstr/unicode unclear if this is fixable

Enables unicode of bstr ^0.2.14

Affects abstraction::DiffableStr.tokenize_unicode_words, abstraction::DiffableStr.tokenize_graphemes, utils::diff_unicode_words, utils::diff_graphemes

bytes = bstr, text

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

unicode-segmentation unicode?
bstr bytes? unicode?

Enables bstr ^0.2.14

serde implicit feature

Enables serde

serde:

A generic serialization/deserialization framework