Skip to content

Commit f5ef5ef

Browse files
committed
book: Add instruction to add once_cell
1 parent d0d4110 commit f5ef5ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

book/src/g_object_signals.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ First we override the `signals` method in `ObjectImpl`.
3434
In order to do that, we need to lazily initialize a static item `SIGNALS`.
3535
Until [`std::sync::LazyLock`](https://doc.rust-lang.org/std/sync/struct.LazyLock.html) is stabilized, we use [`once_cell::sync::Lazy`](https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html) instead.
3636

37+
This also means, we have to add the `once_cell` crate as dependency by executing:
38+
39+
```
40+
cargo add once_cell
41+
```
42+
3743
Filename: <a class=file-link href="https://github.com/gtk-rs/gtk4-rs/blob/master/book/listings/g_object_signals/2/custom_button/imp.rs">listings/g_object_signals/2/custom_button/imp.rs</a>
3844

3945
```rust ,no_run,noplayground

0 commit comments

Comments
 (0)