@@ -13,6 +13,7 @@ import Hax.Core.Panicking
1313import Hax.Core.Result
1414open Rust_primitives.Hax
1515open Core.Ops
16+ open Core.Result
1617open Std.Do
1718set_option mvcgen.warning false
1819
@@ -26,7 +27,7 @@ def Impl.is_some_and
2627 (T : Type ) (F : Type ) [(Function.FnOnce (Output := Bool) F T)] (self :
2728 (Option T))
2829 (f : F)
29- : Result Bool
30+ : RustM Bool
3031 := do
3132 match self with
3233 | (Option.None ) => (pure false )
@@ -37,7 +38,7 @@ def Impl.is_none_or
3738 (T : Type ) (F : Type ) [(Function.FnOnce (Output := Bool) F T)] (self :
3839 (Option T))
3940 (f : F)
40- : Result Bool
41+ : RustM Bool
4142 := do
4243 match self with
4344 | (Option.None ) => (pure true )
@@ -46,7 +47,7 @@ def Impl.is_none_or
4647
4748def Impl.as_ref
4849 (T : Type ) (self : (Option T))
49- : Result (Option T)
50+ : RustM (Option T)
5051 := do
5152 match self with
5253 | (Option.Some x)
@@ -56,7 +57,7 @@ def Impl.as_ref
5657def Impl.unwrap_or
5758 (T : Type ) (self : (Option T))
5859 (default : T)
59- : Result T
60+ : RustM T
6061 := do
6162 match self with
6263 | (Option.Some x) => (pure x)
@@ -68,7 +69,7 @@ def Impl.unwrap_or_else
6869 [(Function.FnOnce F Rust_primitives.Hax.Tuple0 (Output := T))]
6970 (self : (Option T))
7071 (f : F)
71- : Result T
72+ : RustM T
7273 := do
7374 match self with
7475 | (Option.Some x) => (pure x)
@@ -77,7 +78,7 @@ def Impl.unwrap_or_else
7778def Impl.unwrap_or_default
7879 (T : Type ) [(Core.Default.Default T)] (self :
7980 (Option T))
80- : Result T
81+ : RustM T
8182 := do
8283 match self with
8384 | (Option.Some x) => (pure x)
@@ -90,7 +91,7 @@ def Impl.map
9091 [(Function.FnOnce F T (Output := U))]
9192 (self : (Option T))
9293 (f : F)
93- : Result (Option U)
94+ : RustM (Option U)
9495 := do
9596 match self with
9697 | (Option.Some x) => (pure (Option.Some (← (Function.FnOnce.call_once f x))))
@@ -104,7 +105,7 @@ def Impl.map_or
104105 (self : (Option T))
105106 (default : U)
106107 (f : F)
107- : Result U
108+ : RustM U
108109 := do
109110 match self with
110111 | (Option.Some t) => (Function.FnOnce.call_once f t)
@@ -120,7 +121,7 @@ def Impl.map_or_else
120121 (self : (Option T))
121122 (default : D)
122123 (f : F)
123- : Result U
124+ : RustM U
124125 := do
125126 match self with
126127 | (Option.Some t) => (Function.FnOnce.call_once f t)
@@ -134,7 +135,7 @@ def Impl.map_or_default
134135 [(Core.Default.Default U)]
135136 (self : (Option T))
136137 (f : F)
137- : Result U
138+ : RustM U
138139 := do
139140 match self with
140141 | (Option.Some t)
@@ -146,13 +147,13 @@ def Impl.map_or_default
146147def Impl.ok_or
147148 (T : Type ) (E : Type ) (self : (Option T))
148149 (err : E)
149- : Result (Core.Result. Result T E)
150+ : RustM ( Result T E)
150151 := do
151152 match self with
152153 | (Option.Some v)
153- => (pure (Core.Result. Result.Ok v))
154+ => (pure (Result.Ok v))
154155 | (Option.None )
155- => (pure (Core.Result. Result.Err err))
156+ => (pure (Result.Err err))
156157
157158def Impl.ok_or_else
158159 (T : Type )
@@ -161,14 +162,14 @@ def Impl.ok_or_else
161162 [(Function.FnOnce F Rust_primitives.Hax.Tuple0 (Output := E))]
162163 (self : (Option T))
163164 (err : F)
164- : Result (Core.Result. Result T E)
165+ : RustM ( Result T E)
165166 := do
166167 match self with
167168 | (Option.Some v)
168- => (pure (Core.Result. Result.Ok v))
169+ => (pure (Result.Ok v))
169170 | (Option.None )
170171 =>
171- (pure (Core.Result. Result.Err
172+ (pure (Result.Err
172173 (← (Function.FnOnce.call_once
173174 err
174175 Rust_primitives.Hax.Tuple0.mk))))
@@ -180,7 +181,7 @@ def Impl.and_then
180181 [(Function.FnOnce F T (Output := Option U))]
181182 (self : (Option T))
182183 (f : F)
183- : Result (Option U)
184+ : RustM (Option U)
184185 := do
185186 match self with
186187 | (Option.Some x)
@@ -189,7 +190,7 @@ def Impl.and_then
189190
190191def Impl.take
191192 (T : Type ) (self : (Option T))
192- : Result
193+ : RustM
193194 (Rust_primitives.Hax.Tuple2
194195 (Option T)
195196 (Option T))
@@ -198,7 +199,7 @@ def Impl.take
198199
199200def Impl.is_some
200201 (T : Type ) (self : (Option T))
201- : Result Bool
202+ : RustM Bool
202203 := do
203204 match self with
204205 | (Option.Some _) => (pure true )
@@ -217,7 +218,7 @@ def Impl.is_some.spec
217218
218219def Impl.is_none
219220 (T : Type ) (self : (Option T))
220- : Result Bool
221+ : RustM Bool
221222 := do
222223 match self with
223224 | (Option.Some _) => (pure false )
@@ -226,7 +227,7 @@ def Impl.is_none
226227def Impl.expect
227228 (T : Type ) (self : (Option T))
228229 (_msg : String)
229- : Result T
230+ : RustM T
230231 := do
231232 match self with
232233 | (Option.Some val) => (pure val)
@@ -235,13 +236,13 @@ def Impl.expect
235236
236237def Impl.unwrap._.requires
237238 (T : Type ) (self_ : (Option T))
238- : Result Bool
239+ : RustM Bool
239240 := do
240241 (Impl.is_some T self_)
241242
242243def Impl.unwrap
243244 (T : Type ) (self : (Option T))
244- : Result T
245+ : RustM T
245246 := do
246247 match self with
247248 | (Option.Some val) => (pure val)
0 commit comments