Skip to content

Commit

Permalink
Add impl From<BoolLit> for pm::Ident
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKalbertodt committed Dec 19, 2022
1 parent 95af317 commit e9aec00
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/impls.rs
Expand Up @@ -241,6 +241,22 @@ macro_rules! impl_from_tt_for_bool {

helper!(impl_from_tt_for_bool, );

// ==============================================================================================
// ===== `From<BoolLit> for pm::Ident`
// ==============================================================================================

macro_rules! impl_bool_lit_to_pm_lit {
([$($prefix:tt)*] => ) => {
impl From<crate::BoolLit> for $($prefix)* Ident {
fn from(l: crate::BoolLit) -> Self {
Self::new(l.as_str(), $($prefix)* Span::call_site())
}
}
};
}

helper_no_refs!(impl_bool_lit_to_pm_lit, );


mod tests {
//! # Tests
Expand Down

0 comments on commit e9aec00

Please sign in to comment.