mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Implement printf formatting for some parser types
This commit is contained in:
parent
dc4cb84ffc
commit
915db44fbd
2 changed files with 12 additions and 0 deletions
|
@ -322,6 +322,12 @@ impl From<ParseKeyword> for &'static wstr {
|
|||
}
|
||||
}
|
||||
|
||||
impl printf_compat::args::ToArg<'static> for ParseKeyword {
|
||||
fn to_arg(self) -> printf_compat::args::Arg<'static> {
|
||||
printf_compat::args::Arg::Str(self.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn keyword_description(keyword: ParseKeyword) -> wcharz_t {
|
||||
let s: &'static wstr = keyword.into();
|
||||
wcharz!(s)
|
||||
|
|
|
@ -258,6 +258,12 @@ impl From<TokenizerError> for &'static wstr {
|
|||
}
|
||||
}
|
||||
|
||||
impl printf_compat::args::ToArg<'static> for TokenizerError {
|
||||
fn to_arg(self) -> printf_compat::args::Arg<'static> {
|
||||
printf_compat::args::Arg::Str(self.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl Tok {
|
||||
fn new(r#type: TokenType) -> Tok {
|
||||
Tok {
|
||||
|
|
Loading…
Reference in a new issue