Skip to content

Commit

Permalink
Fix some clippy warnings in pids::to_latex_str
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Aug 27, 2024
1 parent 741dcb9 commit 56374b3
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions pineappl/src/pids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,35 @@ impl PidBasis {

/// Convert the PID `pid` in the basis given by `self` into a LaTeX string that represents the
/// particle.
#[must_use]
pub fn to_latex_str(&self, pid: i32) -> &'static str {
match (*self, pid) {
(PidBasis::Evol | PidBasis::Pdg, -6) => r"\bar{\mathrm{t}}",
(PidBasis::Evol | PidBasis::Pdg, -5) => r"\bar{\mathrm{b}}",
(PidBasis::Evol | PidBasis::Pdg, -4) => r"\bar{\mathrm{c}}",
(PidBasis::Evol | PidBasis::Pdg, -3) => r"\bar{\mathrm{s}}",
(PidBasis::Evol | PidBasis::Pdg, -2) => r"\bar{\mathrm{u}}",
(PidBasis::Evol | PidBasis::Pdg, -1) => r"\bar{\mathrm{d}}",
(PidBasis::Evol | PidBasis::Pdg, 1) => r"\mathrm{d}",
(PidBasis::Evol | PidBasis::Pdg, 2) => r"\mathrm{u}",
(PidBasis::Evol | PidBasis::Pdg, 3) => r"\mathrm{s}",
(PidBasis::Evol | PidBasis::Pdg, 4) => r"\mathrm{c}",
(PidBasis::Evol | PidBasis::Pdg, 5) => r"\mathrm{b}",
(PidBasis::Evol | PidBasis::Pdg, 6) => r"\mathrm{t}",
(PidBasis::Evol | PidBasis::Pdg, 21) => r"\mathrm{g}",
(PidBasis::Evol | PidBasis::Pdg, 22) => r"\gamma",
(PidBasis::Evol, 100) => r"\Sigma",
(PidBasis::Evol, 103) => r"\mathrm{T}_3",
(PidBasis::Evol, 108) => r"\mathrm{T}_8",
(PidBasis::Evol, 115) => r"\mathrm{T}_{15}",
(PidBasis::Evol, 124) => r"\mathrm{T}_{24}",
(PidBasis::Evol, 135) => r"\mathrm{T}_{35}",
(PidBasis::Evol, 200) => r"\mathrm{V}",
(PidBasis::Evol, 203) => r"\mathrm{V}_3",
(PidBasis::Evol, 208) => r"\mathrm{V}_8",
(PidBasis::Evol, 215) => r"\mathrm{V}_{15}",
(PidBasis::Evol, 224) => r"\mathrm{V}_{24}",
(PidBasis::Evol, 235) => r"\mathrm{V}_{35}",
(Self::Evol | Self::Pdg, -6) => r"\bar{\mathrm{t}}",
(Self::Evol | Self::Pdg, -5) => r"\bar{\mathrm{b}}",
(Self::Evol | Self::Pdg, -4) => r"\bar{\mathrm{c}}",
(Self::Evol | Self::Pdg, -3) => r"\bar{\mathrm{s}}",
(Self::Evol | Self::Pdg, -2) => r"\bar{\mathrm{u}}",
(Self::Evol | Self::Pdg, -1) => r"\bar{\mathrm{d}}",
(Self::Evol | Self::Pdg, 1) => r"\mathrm{d}",
(Self::Evol | Self::Pdg, 2) => r"\mathrm{u}",
(Self::Evol | Self::Pdg, 3) => r"\mathrm{s}",
(Self::Evol | Self::Pdg, 4) => r"\mathrm{c}",
(Self::Evol | Self::Pdg, 5) => r"\mathrm{b}",
(Self::Evol | Self::Pdg, 6) => r"\mathrm{t}",
(Self::Evol | Self::Pdg, 21) => r"\mathrm{g}",
(Self::Evol | Self::Pdg, 22) => r"\gamma",
(Self::Evol, 100) => r"\Sigma",
(Self::Evol, 103) => r"\mathrm{T}_3",
(Self::Evol, 108) => r"\mathrm{T}_8",
(Self::Evol, 115) => r"\mathrm{T}_{15}",
(Self::Evol, 124) => r"\mathrm{T}_{24}",
(Self::Evol, 135) => r"\mathrm{T}_{35}",
(Self::Evol, 200) => r"\mathrm{V}",
(Self::Evol, 203) => r"\mathrm{V}_3",
(Self::Evol, 208) => r"\mathrm{V}_8",
(Self::Evol, 215) => r"\mathrm{V}_{15}",
(Self::Evol, 224) => r"\mathrm{V}_{24}",
(Self::Evol, 235) => r"\mathrm{V}_{35}",
_ => unimplemented!(
"conversion of PID `{pid}` in basis {self:?} to LaTeX string unknown"
),
Expand Down

0 comments on commit 56374b3

Please sign in to comment.