File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -157,23 +157,25 @@ impl Eligibility {
157157 None
158158 }
159159 }
160+ }
160161
162+ impl Into < bool > for Eligibility {
161163 /// This is a quality of life helper that allows users of this api to say:
162- /// `if bundle.is_eligible(block).as_bool () { .. }`, without going into the
164+ /// `if bundle.is_eligible(block).into () {. }`, without going into the
163165 /// details of the eligibility.
164- pub fn as_bool ( self ) -> bool {
166+ fn into ( self ) -> bool {
165167 matches ! ( self , Eligibility :: Eligible )
166168 }
167169}
168170
169171/// This is a quality of life helper that allows users of this api to say:
170- /// `if !bundle.is_eligible(block) { .. }`, without going into the details of
172+ /// `if !bundle.is_eligible(block) {. }`, without going into the details of
171173/// the ineligibility.
172174impl Not for Eligibility {
173175 type Output = bool ;
174176
175177 fn not ( self ) -> Self :: Output {
176- !self . as_bool ( )
178+ !< Eligibility as Into < bool > > :: into ( self )
177179 }
178180}
179181
You can’t perform that action at this time.
0 commit comments