blob: fbbf6340ab069d9c87df7a3140fc1b80b1a2dc54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
It's possible to tell the compiler that we want something garbage collected.
Reference counted pointer:
```rust
use std::rc::Rc
fn return() -> Rc<String> {
let s = Rc::new(String::from("Hello"));
Rc::clone(&s)
}
```
|