File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 13
13
up picking the same element twice from a given list.
14
14
- Improved formatting of JavaScript errors in ` string.inspect ` .
15
15
- JavaScript circular references can now be printed by ` string.inspect ` .
16
+ - The alias ` result.then ` was deprecated in favour of using ` result.try `
17
+ directly.
16
18
17
19
## v0.60.0 - 2025-05-13
18
20
Original file line number Diff line number Diff line change @@ -165,8 +165,7 @@ pub fn try(
165
165
}
166
166
}
167
167
168
- /// An alias for `try`. See the documentation for that function for more information.
169
- ///
168
+ @ deprecated ( "This function is an alias of result.try, use that instead" )
170
169
pub fn then (
171
170
result : Result ( a, e) ,
172
171
apply fun : fn ( a) -> Result ( b, e) ,
Original file line number Diff line number Diff line change @@ -48,16 +48,6 @@ pub fn try_test() {
48
48
assert result.try(Ok(1), fn(_) { Error(1) }) == Error(1)
49
49
}
50
50
51
- pub fn then_test() {
52
- assert result.then(Error(1), fn(x) { Ok(x + 1) }) == Error(1)
53
-
54
- assert result.then(Ok(1), fn(x) { Ok(x + 1) }) == Ok(2)
55
-
56
- assert result.then(Ok(1), fn(_) { Ok("type change") }) == Ok("type change")
57
-
58
- assert result.then(Ok(1), fn(_) { Error(1) }) == Error(1)
59
- }
60
-
61
51
pub fn unwrap_test() {
62
52
assert result.unwrap(Ok(1), 50) == 1
63
53
You can’t perform that action at this time.
0 commit comments