Skip to content

Commit 5467f97

Browse files
committed
Fix section on prelude re-exports
This reworks the description of prelude re-export, in order to clarify that only blanket traits are re-exported. It also fixes the example to use a real trait from gdk.
1 parent e2a4fda commit 5467f97

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

_posts/2021-06-22-new-release.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ to be able to use them. Now, you only need to import GTK and then you can do:
8585
use gtk::{cairo, gdk};
8686
```
8787

88-
And that's it! It'll make your management of dependencies much simpler. To be noted, they are also
89-
in the `prelude`, so importing it will give you access to them:
88+
And that's it! It'll make your management of dependencies much simpler. To be noted, relevant traits
89+
are also re-exported in the `prelude`, so importing it will give you access to them:
9090

9191
```rust
92+
use gtk::gdk;
9293
use gtk::prelude::*;
9394

9495
// ...
95-
let x = cairo::something();
96-
let y = gdk::something();
96+
// This uses the `gdk::prelude::WindowExtManual` trait, through the prelude.
97+
let w = gdk::Window::default_root_window();
9798
```
9899

99100
Last note about the re-exports: the `-sys` crates are also re-exported under the name `ffi`:

0 commit comments

Comments
 (0)