From dec361efa96c8623496422a529ebc495cc318895 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sun, 25 Sep 2022 14:41:29 +0200 Subject: [PATCH] opt --- src/opts.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/opts.rs b/src/opts.rs index 760c422..14b8671 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -8,6 +8,13 @@ pub enum Alignment { Unknown, } +mod sealed { + pub trait SealedOpts {} + + impl SealedOpts for () {} + impl SealedOpts for &'_ O {} +} + macro_rules! options { ( $( @@ -21,7 +28,7 @@ macro_rules! options { )* ) => { // FIXME: We can get rid of this Copy can't we - pub trait FmtOpts: Copy { + pub trait FmtOpts: sealed::SealedOpts + Copy { #[doc(hidden)] type Inner: FmtOpts; @@ -103,6 +110,8 @@ macro_rules! options { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct $with_name(#[doc(hidden)] pub I); + impl sealed::SealedOpts for $with_name {} + impl FmtOpts for $with_name { type Inner = I;