You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-08-08 08:22:52 +02:00
fix raii drop bomb example
This commit is contained in:
@ -7,6 +7,8 @@ This pattern is often used when the finalizing operation (like `commit()` or
|
|||||||
`rollback()`) needs to return a `Result`, which cannot be done from `Drop`.
|
`rollback()`) needs to return a `Result`, which cannot be done from `Drop`.
|
||||||
|
|
||||||
```rust,editable
|
```rust,editable
|
||||||
|
use std::io::{self, Write};
|
||||||
|
|
||||||
struct Transaction {
|
struct Transaction {
|
||||||
active: bool,
|
active: bool,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user