File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,25 +7,6 @@ use core::option::Option::Some;
77
88verus ! {
99
10- impl <T > View for Option <T > {
11- type V = Option <T >;
12-
13- open spec fn view( & self ) -> Option <T > {
14- * self
15- }
16- }
17-
18- impl <T : DeepView > DeepView for Option <T > {
19- type V = Option <T :: V >;
20-
21- open spec fn deep_view( & self ) -> Option <T :: V > {
22- match self {
23- Some ( t) => Some ( t. deep_view( ) ) ,
24- None => None ,
25- }
26- }
27- }
28-
2910////// Add is_variant-style spec functions
3011pub trait OptionAdditionalFns <T >: Sized {
3112 #[ deprecated( note = "is_Variant is deprecated - use `->` or `matches` instead: https://verus-lang.github.io/verus/guide/datatypes_enum.html" ) ]
Original file line number Diff line number Diff line change @@ -134,6 +134,25 @@ impl<T: DeepView> DeepView for alloc::vec::Vec<T> {
134134 }
135135}
136136
137+ impl <T > View for Option <T > {
138+ type V = Option <T >;
139+
140+ open spec fn view( & self ) -> Option <T > {
141+ * self
142+ }
143+ }
144+
145+ impl <T : DeepView > DeepView for Option <T > {
146+ type V = Option <T :: V >;
147+
148+ open spec fn deep_view( & self ) -> Option <T :: V > {
149+ match self {
150+ Some ( t) => Some ( t. deep_view( ) ) ,
151+ None => None ,
152+ }
153+ }
154+ }
155+
137156macro_rules! declare_identity_view {
138157 ( $t: ty) => {
139158 #[ cfg_attr( verus_keep_ghost, verifier:: verify) ]
You can’t perform that action at this time.
0 commit comments