Fix some clippy warning from Rust 1.78.0 (#4444)
This commit is contained in:
@@ -21,12 +21,12 @@ pub(crate) struct FrameState {
|
||||
/// All [`Id`]s that were used this frame.
|
||||
pub(crate) used_ids: IdMap<Rect>,
|
||||
|
||||
/// Starts off as the screen_rect, shrinks as panels are added.
|
||||
/// Starts off as the `screen_rect`, shrinks as panels are added.
|
||||
/// The [`CentralPanel`] does not change this.
|
||||
/// This is the area available to Window's.
|
||||
pub(crate) available_rect: Rect,
|
||||
|
||||
/// Starts off as the screen_rect, shrinks as panels are added.
|
||||
/// Starts off as the `screen_rect`, shrinks as panels are added.
|
||||
/// The [`CentralPanel`] retracts from this.
|
||||
pub(crate) unused_rect: Rect,
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ pub struct InputState {
|
||||
/// State of the mouse or simple touch gestures which can be mapped to mouse operations.
|
||||
pub pointer: PointerState,
|
||||
|
||||
/// State of touches, except those covered by PointerState (like clicks and drags).
|
||||
/// State of touches, except those covered by `PointerState` (like clicks and drags).
|
||||
/// (We keep a separate [`TouchState`] for each encountered touch device.)
|
||||
touch_states: BTreeMap<TouchDeviceId, TouchState>,
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ pub(crate) struct TouchState {
|
||||
|
||||
/// Active touches, if any.
|
||||
///
|
||||
/// TouchId is the unique identifier of the touch. It is valid as long as the finger/pen touches the surface. The
|
||||
/// `TouchId` is the unique identifier of the touch. It is valid as long as the finger/pen touches the surface. The
|
||||
/// next touch will receive a new unique ID.
|
||||
///
|
||||
/// Refer to [`ActiveTouch`].
|
||||
|
||||
@@ -13,7 +13,7 @@ pub(crate) struct Region {
|
||||
/// Always finite.
|
||||
///
|
||||
/// The bounding box of all child widgets, but not necessarily a tight bounding box
|
||||
/// since [`Ui`](crate::Ui) can start with a non-zero min_rect size.
|
||||
/// since [`Ui`](crate::Ui) can start with a non-zero `min_rect` size.
|
||||
pub min_rect: Rect,
|
||||
|
||||
/// The maximum size of this [`Ui`](crate::Ui). This is a *soft max*
|
||||
@@ -38,7 +38,7 @@ pub(crate) struct Region {
|
||||
/// So one can think of `cursor` as a constraint on the available region.
|
||||
///
|
||||
/// If something has already been added, this will point to `style.spacing.item_spacing` beyond the latest child.
|
||||
/// The cursor can thus be `style.spacing.item_spacing` pixels outside of the min_rect.
|
||||
/// The cursor can thus be `style.spacing.item_spacing` pixels outside of the `min_rect`.
|
||||
pub(crate) cursor: Rect,
|
||||
}
|
||||
|
||||
|
||||
@@ -5,19 +5,19 @@ pub enum OperatingSystem {
|
||||
/// Unknown OS - could be wasm
|
||||
Unknown,
|
||||
|
||||
/// Android OS.
|
||||
/// Android OS
|
||||
Android,
|
||||
|
||||
/// Apple iPhone OS.
|
||||
/// Apple iPhone OS
|
||||
IOS,
|
||||
|
||||
/// Linux or Unix other than Android.
|
||||
/// Linux or Unix other than Android
|
||||
Nix,
|
||||
|
||||
/// MacOS.
|
||||
/// macOS
|
||||
Mac,
|
||||
|
||||
/// Windows.
|
||||
/// Windows
|
||||
Windows,
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ pub struct Style {
|
||||
///
|
||||
/// The most convenient way to look something up in this is to use [`TextStyle::resolve`].
|
||||
///
|
||||
/// If you would like to overwrite app text_styles
|
||||
/// If you would like to overwrite app `text_styles`
|
||||
///
|
||||
/// ```
|
||||
/// # let mut ctx = egui::Context::default();
|
||||
|
||||
@@ -59,8 +59,8 @@ pub struct Undoer<State> {
|
||||
|
||||
/// Stores redos immediately after a sequence of undos.
|
||||
/// Gets cleared every time the state changes.
|
||||
/// Does not need to be a deque, because there can only be up to undos.len() redos,
|
||||
/// which is already limited to settings.max_undos.
|
||||
/// Does not need to be a deque, because there can only be up to `undos.len()` redos,
|
||||
/// which is already limited to `settings.max_undos`.
|
||||
redos: Vec<State>,
|
||||
|
||||
#[cfg_attr(feature = "serde", serde(skip))]
|
||||
|
||||
@@ -1071,7 +1071,7 @@ pub enum ViewportCommand {
|
||||
/// This is equivalent to the system keyboard shortcut for copy (e.g. CTRL + C).
|
||||
RequestCopy,
|
||||
|
||||
/// Request a paste from the clipboard to the current focused TextEdit if any.
|
||||
/// Request a paste from the clipboard to the current focused `TextEdit` if any.
|
||||
///
|
||||
/// This is equivalent to the system keyboard shortcut for paste (e.g. CTRL + V).
|
||||
RequestPaste,
|
||||
|
||||
@@ -220,7 +220,7 @@ impl TextBuffer for String {
|
||||
}
|
||||
|
||||
fn replace_with(&mut self, text: &str) {
|
||||
*self = text.to_owned();
|
||||
text.clone_into(self);
|
||||
}
|
||||
|
||||
fn take(&mut self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user