Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various new clippy warnings #1827

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading