diff options
| author | Malo <57839069+MDLC01@users.noreply.github.com> | 2025-06-26 09:24:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-26 08:24:21 +0000 |
| commit | 04fd0acacab8cf2e82268da9c18ef4bcf37507dc (patch) | |
| tree | d01aa881ebdab6f3925af65c18d71b1103836c90 /docs/src | |
| parent | 6a1d6c08e2d6e4c184c6d177e67796b23ccbe4c7 (diff) | |
Allow deprecating symbol variants (#6441)
Diffstat (limited to 'docs/src')
| -rw-r--r-- | docs/src/lib.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/docs/src/lib.rs b/docs/src/lib.rs index 9bd21c2e..dc6b62c7 100644 --- a/docs/src/lib.rs +++ b/docs/src/lib.rs @@ -720,18 +720,12 @@ fn symbols_model(resolver: &dyn Resolver, group: &GroupData) -> SymbolsModel { } }; - for (variant, c) in symbol.variants() { + for (variant, c, deprecation) in symbol.variants() { let shorthand = |list: &[(&'static str, char)]| { list.iter().copied().find(|&(_, x)| x == c).map(|(s, _)| s) }; let name = complete(variant); - let deprecation = match name.as_str() { - "integral.sect" => { - Some("`integral.sect` is deprecated, use `integral.inter` instead") - } - _ => binding.deprecation(), - }; list.push(SymbolModel { name, @@ -742,10 +736,10 @@ fn symbols_model(resolver: &dyn Resolver, group: &GroupData) -> SymbolsModel { accent: typst::math::Accent::combine(c).is_some(), alternates: symbol .variants() - .filter(|(other, _)| other != &variant) - .map(|(other, _)| complete(other)) + .filter(|(other, _, _)| other != &variant) + .map(|(other, _, _)| complete(other)) .collect(), - deprecation, + deprecation: deprecation.or_else(|| binding.deprecation()), }); } } |
