mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 05:47:53 +00:00
refactor(command_parser): move parameter fmt to Parameter types Display impl
This commit is contained in:
parent
58d493ac0a
commit
e3778b9bb8
3 changed files with 43 additions and 36 deletions
|
|
@ -2,7 +2,7 @@ use std::fmt::Display;
|
|||
|
||||
use smol_str::SmolStr;
|
||||
|
||||
use crate::parameter::{ParameterKind, ParameterValue};
|
||||
use crate::parameter::{Parameter, ParameterKind, ParameterValue};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FlagValueMatchError {
|
||||
|
|
@ -22,7 +22,7 @@ impl Display for Flag {
|
|||
write!(f, "-{}", self.name)?;
|
||||
if let Some(value) = self.value.as_ref() {
|
||||
write!(f, "=")?;
|
||||
value.format(f, value.default_name())?;
|
||||
Parameter::from(*value).fmt(f)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue