File tree 2 files changed +3
-3
lines changed
std/shared/src/main/scala/cats/effect/std
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ to `Hotswap` which remove the `Option` wrapper.
16
16
17
17
``` scala
18
18
sealed trait NonEmptyHotswap [F [_], R ] {
19
- def swap (next : Resource [F , R ]): F [R ]
19
+ def swap (next : Resource [F , R ]): F [Unit ]
20
20
def get : Resource [F , R ]
21
21
}
22
22
```
Original file line number Diff line number Diff line change @@ -117,12 +117,12 @@ object NonEmptyHotswap {
117
117
Resource .make(initialize)(finalize).map { state =>
118
118
new NonEmptyHotswap [F , R ] {
119
119
120
- override def swap (next : Resource [F , R ]): F [R ] =
120
+ override def swap (next : Resource [F , R ]): F [Unit ] =
121
121
F .uncancelable { poll =>
122
122
poll(next.allocated).flatMap {
123
123
case (r, fin) =>
124
124
exclusive.mapK(poll).onCancel(Resource .eval(fin)).surround {
125
- swapFinalizer(Acquired (r, fin)).as(r)
125
+ swapFinalizer(Acquired (r, fin))
126
126
}
127
127
}
128
128
}
You can’t perform that action at this time.
0 commit comments