diff --git a/Cargo.toml b/Cargo.toml index 4032a4f1..2397a491 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,22 @@ license = "MIT" keywords = ["text", "split", "tokenizer", "nlp", "ai"] categories = ["text-processing"] + +[workspace.lints.rust] +future_incompatible = { level = "warn", priority = -1 } +missing_debug_implementations = "warn" +missing_docs = "warn" +nonstandard_style = { level = "warn", priority = -1 } +rust_2018_compatibility = { level = "warn", priority = -1 } +rust_2018_idioms = { level = "warn", priority = -1 } +rust_2021_compatibility = { level = "warn", priority = -1 } +rust_2024_compatibility = { level = "warn", priority = -1 } +unused = { level = "warn", priority = -1 } + +[workspace.lints.clippy] +cargo = "warn" +pedantic = "warn" + [package] name = "text-splitter" version.workspace = true @@ -84,20 +100,8 @@ rust-tokenizers = ["dep:rust_tokenizers"] tiktoken-rs = ["dep:tiktoken-rs"] tokenizers = ["dep:tokenizers"] -[lints.rust] -future_incompatible = { level = "warn", priority = -1 } -missing_debug_implementations = "warn" -missing_docs = "warn" -nonstandard_style = { level = "warn", priority = -1 } -rust_2018_compatibility = { level = "warn", priority = -1 } -rust_2018_idioms = { level = "warn", priority = -1 } -rust_2021_compatibility = { level = "warn", priority = -1 } -rust_2024_compatibility = { level = "warn", priority = -1 } -unused = { level = "warn", priority = -1 } - -[lints.clippy] -cargo = "warn" -pedantic = "warn" +[lints] +workspace = true # Tokenizers and indirect deps can cause slow runtime [profile.dev.package."*"] diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 4a240f16..d75b98d1 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -26,3 +26,6 @@ tiktoken-rs = "0.5.8" tokenizers = { version = "0.19.1", default_features = false, features = [ "onig", ] } + +[lints] +workspace = true diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index 9d54b2d6..424b3d68 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -1,18 +1,7 @@ //! Python Bindings for text-splitter crate -#![warn( - clippy::pedantic, - future_incompatible, - missing_debug_implementations, - missing_docs, - nonstandard_style, - rust_2018_compatibility, - rust_2018_idioms, - rust_2021_compatibility, - unused -)] -// pyo3 uses this -#![allow(elided_lifetimes_in_paths)] +// pyo3 uses these +#![allow(elided_lifetimes_in_paths, unsafe_op_in_unsafe_fn)] use std::str::FromStr;