fc6b7c8b38
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
10 lines
231 B
Rust
10 lines
231 B
Rust
resource finish<T>(arg: {val: T, fin: fn(T)}) { arg.fin(arg.val); }
|
|
|
|
fn main() {
|
|
let box = @mutable 10;
|
|
fn dec_box(i: @mutable int) { *i -= 1; }
|
|
|
|
{ let i <- finish({val: box, fin: dec_box}); }
|
|
assert (*box == 9);
|
|
}
|