Skip to content

Commit

Permalink
Merge pull request #1827 from sdroege/clippy-warnings
Browse files Browse the repository at this point in the history
Fix various new clippy warnings
  • Loading branch information
sdroege authored Aug 27, 2024
2 parents e39dfca + d8921e0 commit 8d277a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 3 additions & 1 deletion gdk4-wayland/src/wayland_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use glib::translate::*;
#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))]
use wayland_client::{backend::ObjectId, protocol::wl_surface::WlSurface, Proxy};

use crate::{ffi, prelude::*, WaylandSurface};
#[cfg(feature = "wayland_crate")]
use crate::ffi;
use crate::{prelude::*, WaylandSurface};

mod sealed {
pub trait Sealed {}
Expand Down
8 changes: 3 additions & 5 deletions gtk4-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,10 @@ pub fn composite_template_derive(input: TokenStream) -> TokenStream {
/// exposed to the template scope. It can take the following options:
/// - `name` renames the callback. Defaults to the function name if not defined.
/// - `function` ignores the first value when calling the callback and disallows
/// `self`. Useful
/// for callbacks called from `<closure>` tags.
/// `self`. Useful for callbacks called from `<closure>` tags.
/// - `function = false` reverts the effects of `functions` used on the `impl`,
/// so the callback
/// gets the first value and can take `self` again. Mainly useful for callbacks
/// that are invoked with `swapped="true"`.
/// so the callback gets the first value and can take `self` again. Mainly useful
/// for callbacks that are invoked with `swapped="true"`.
///
/// The `rest` attribute can be placed on the last argument of a template
/// callback. This attribute must be used on an argument of type
Expand Down
9 changes: 4 additions & 5 deletions gtk4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,15 @@ The [`gtk`](mod@crate) and [`gdk`][`mod@gdk`] crates have some run-time safety a
checks.

- Any constructor or free function will panic if called before [`init`][`fn@init`] or on
a non-main thread.
a non-main thread.

- Any [`&str`] or [`&Path`](std::path::Path) parameter with an interior null (`\0`) character will
cause a panic.
- Any [`&str`] or [`&Path`](std::path::Path) parameter with an interior null (`\0`) character will cause a panic.

- Some functions will panic if supplied out-of-range integer parameters. All
such cases will be documented individually but they are not yet.
such cases will be documented individually but they are not yet.

- A panic in a closure that handles signals or in any other closure passed
to a [`gtk`](mod@crate) function will abort the process.
to a [`gtk`](mod@crate) function will abort the process.

## Features

Expand Down

0 comments on commit 8d277a6

Please sign in to comment.