mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Explicitly add schemars to ruff_python_ast Cargo.toml (#12275)
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
bbb9fe1692
commit
d0298dc26d
3 changed files with 8 additions and 8 deletions
|
@ -30,7 +30,9 @@ serde = { workspace = true, optional = true }
|
|||
compact_str = { workspace = true }
|
||||
|
||||
[features]
|
||||
serde = ["dep:serde", "ruff_text_size/serde", "dep:ruff_cache", "compact_str/serde", "dep:ruff_macros", "dep:schemars"]
|
||||
schemars = ["dep:schemars"]
|
||||
cache = ["dep:ruff_cache", "dep:ruff_macros"]
|
||||
serde = ["dep:serde", "ruff_text_size/serde", "dep:ruff_cache", "compact_str/serde"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -6,10 +6,8 @@ use std::ops::Deref;
|
|||
use crate::{nodes, Expr};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
derive(serde::Serialize, serde::Deserialize, ruff_macros::CacheKey)
|
||||
)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "cache", derive(ruff_macros::CacheKey))]
|
||||
pub struct Name(compact_str::CompactString);
|
||||
|
||||
impl Name {
|
||||
|
@ -179,7 +177,7 @@ impl PartialEq<Name> for &String {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
#[cfg(feature = "schemars")]
|
||||
impl schemars::JsonSchema for Name {
|
||||
fn is_referenceable() -> bool {
|
||||
String::is_referenceable()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue