janitor: Fix warnings in nightly about redandant use

This commit is contained in:
Tobias Hunger 2024-02-19 14:25:47 +01:00 committed by Tobias Hunger
parent 1d987a4547
commit a8f912900b
35 changed files with 35 additions and 13 deletions

View file

@ -7,7 +7,6 @@
//! guaranteed //! guaranteed
#![doc(hidden)] #![doc(hidden)]
use alloc::rc::Rc;
use core::pin::Pin; use core::pin::Pin;
use re_exports::*; use re_exports::*;

View file

@ -6,7 +6,6 @@
//! implementation of vtable::Vrc //! implementation of vtable::Vrc
use super::*; use super::*;
use core::convert::TryInto;
use portable_atomic::{AtomicU32, Ordering}; use portable_atomic::{AtomicU32, Ordering};
/// This trait is implemented by the [`#[vtable]`](macro@vtable) macro. /// This trait is implemented by the [`#[vtable]`](macro@vtable) macro.

View file

@ -14,7 +14,7 @@ This module has different sub modules with the actual parser functions
use crate::diagnostics::{BuildDiagnostics, SourceFile, SourceFileVersion, Spanned}; use crate::diagnostics::{BuildDiagnostics, SourceFile, SourceFileVersion, Spanned};
pub use smol_str::SmolStr; pub use smol_str::SmolStr;
use std::{convert::TryFrom, fmt::Display}; use std::fmt::Display;
mod document; mod document;
mod element; mod element;

View file

@ -3,6 +3,7 @@
// cSpell: ignore descendents // cSpell: ignore descendents
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use crate::items::ItemRc; use crate::items::ItemRc;

View file

@ -4,6 +4,7 @@
#![warn(missing_docs)] #![warn(missing_docs)]
//! The animation system //! The animation system
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use core::cell::Cell; use core::cell::Cell;
#[cfg(not(feature = "std"))] #[cfg(not(feature = "std"))]

View file

@ -12,7 +12,9 @@ pub use crate::future::*;
use crate::input::{KeyEventType, MouseEvent}; use crate::input::{KeyEventType, MouseEvent};
use crate::item_tree::ItemTreeVTable; use crate::item_tree::ItemTreeVTable;
use crate::window::{WindowAdapter, WindowInner}; use crate::window::{WindowAdapter, WindowInner};
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
use alloc::string::String; use alloc::string::String;
/// A position represented in the coordinate space of logical pixels. That is the space before applying /// A position represented in the coordinate space of logical pixels. That is the space before applying

View file

@ -10,6 +10,7 @@ but then it should also be renamed everywhere, including in the language grammar
#![warn(missing_docs)] #![warn(missing_docs)]
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use core::cell::Cell; use core::cell::Cell;

View file

@ -6,6 +6,7 @@
//! This module defines a `ComponentFactory` and related code. //! This module defines a `ComponentFactory` and related code.
use crate::api::ComponentHandle; use crate::api::ComponentHandle;
use crate::item_tree::{ItemTreeRc, ItemTreeVTable, ItemTreeWeak}; use crate::item_tree::{ItemTreeRc, ItemTreeVTable, ItemTreeWeak};
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
use core::fmt::Debug; use core::fmt::Debug;

View file

@ -5,6 +5,7 @@ use crate::api::PlatformError;
use crate::platform::{EventLoopProxy, Platform}; use crate::platform::{EventLoopProxy, Platform};
#[cfg(all(not(feature = "std"), feature = "unsafe-single-threaded"))] #[cfg(all(not(feature = "std"), feature = "unsafe-single-threaded"))]
use crate::thread_local; use crate::thread_local;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;

View file

@ -8,8 +8,10 @@
use crate::api::EventLoopError; use crate::api::EventLoopError;
use crate::SlintContext; use crate::SlintContext;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::task::Wake; use alloc::task::Wake;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::future::Future; use core::future::Future;
use core::ops::DerefMut; use core::ops::DerefMut;

View file

@ -14,6 +14,7 @@ extern crate alloc;
use crate::lengths::LogicalLength; use crate::lengths::LogicalLength;
use crate::Coord; use crate::Coord;
use crate::SharedString; use crate::SharedString;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
pub use euclid; pub use euclid;

View file

@ -5,7 +5,6 @@
This module contains border radius related types for the run-time library. This module contains border radius related types for the run-time library.
*/ */
use core::cmp::{Eq, PartialEq};
use core::fmt; use core::fmt;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};

View file

@ -7,7 +7,6 @@ This module contains a cache helper for caching box shadow textures.
use std::{cell::RefCell, collections::BTreeMap}; use std::{cell::RefCell, collections::BTreeMap};
use super::euclid;
use crate::items::ItemRc; use crate::items::ItemRc;
use crate::lengths::RectLengths; use crate::lengths::RectLengths;
use crate::{ use crate::{

View file

@ -10,7 +10,9 @@ use crate::debug_log;
use crate::timers::{Timer, TimerMode}; use crate::timers::{Timer, TimerMode};
use alloc::format; use alloc::format;
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::string::String; use alloc::string::String;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cell::RefCell; use core::cell::RefCell;

View file

@ -15,6 +15,7 @@ use crate::timers::Timer;
use crate::window::{WindowAdapter, WindowInner}; use crate::window::{WindowAdapter, WindowInner};
use crate::{Coord, Property, SharedString}; use crate::{Coord, Property, SharedString};
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use const_field_offset::FieldOffsets; use const_field_offset::FieldOffsets;
use core::cell::Cell; use core::cell::Cell;

View file

@ -8,15 +8,14 @@ use super::graphics::RenderingCache;
use super::items::*; use super::items::*;
use crate::graphics::{CachedGraphicsData, Image, IntRect}; use crate::graphics::{CachedGraphicsData, Image, IntRect};
use crate::item_tree::ItemTreeRc; use crate::item_tree::ItemTreeRc;
use crate::item_tree::{ use crate::item_tree::{ItemVisitor, ItemVisitorResult, ItemVisitorVTable, VisitChildrenResult};
ItemRc, ItemVisitor, ItemVisitorResult, ItemVisitorVTable, VisitChildrenResult,
};
use crate::lengths::{ use crate::lengths::{
LogicalBorderRadius, LogicalLength, LogicalPoint, LogicalPx, LogicalRect, LogicalSize, LogicalBorderRadius, LogicalLength, LogicalPoint, LogicalPx, LogicalRect, LogicalSize,
LogicalVector, LogicalVector,
}; };
use crate::properties::PropertyTracker; use crate::properties::PropertyTracker;
use crate::{Brush, Coord}; use crate::{Brush, Coord};
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use core::cell::{Cell, RefCell}; use core::cell::{Cell, RefCell};
use core::pin::Pin; use core::pin::Pin;

View file

@ -22,6 +22,7 @@ use crate::properties::{Property, PropertyTracker};
#[cfg(feature = "rtti")] #[cfg(feature = "rtti")]
use crate::rtti::*; use crate::rtti::*;
use crate::window::WindowAdapter; use crate::window::WindowAdapter;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
use const_field_offset::FieldOffsets; use const_field_offset::FieldOffsets;

View file

@ -23,6 +23,7 @@ use crate::lengths::{
use crate::rtti::*; use crate::rtti::*;
use crate::window::WindowAdapter; use crate::window::WindowAdapter;
use crate::Property; use crate::Property;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
use const_field_offset::FieldOffsets; use const_field_offset::FieldOffsets;

View file

@ -26,6 +26,7 @@ use crate::rtti::*;
use crate::window::{InputMethodProperties, InputMethodRequest, WindowAdapter, WindowInner}; use crate::window::{InputMethodProperties, InputMethodRequest, WindowAdapter, WindowInner};
use crate::{Callback, Coord, Property, SharedString, SharedVector}; use crate::{Callback, Coord, Property, SharedString, SharedVector};
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::string::String; use alloc::string::String;
use const_field_offset::FieldOffsets; use const_field_offset::FieldOffsets;
use core::cell::Cell; use core::cell::Cell;

View file

@ -16,8 +16,10 @@ pub use crate::software_renderer;
use crate::unsafe_single_threaded::OnceCell; use crate::unsafe_single_threaded::OnceCell;
pub use crate::window::{LayoutConstraints, WindowAdapter, WindowProperties}; pub use crate::window::{LayoutConstraints, WindowAdapter, WindowProperties};
use crate::SharedString; use crate::SharedString;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::string::String; use alloc::string::String;
#[cfg(feature = "std")] #[cfg(feature = "std")]
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;

View file

@ -16,6 +16,7 @@
/// A singled linked list whose nodes are pinned /// A singled linked list whose nodes are pinned
mod single_linked_list_pin { mod single_linked_list_pin {
#![allow(unsafe_code)] #![allow(unsafe_code)]
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use core::pin::Pin; use core::pin::Pin;
@ -224,6 +225,7 @@ pub(crate) mod dependency_tracker {
type DependencyListHead = dependency_tracker::DependencyListHead<*const BindingHolder>; type DependencyListHead = dependency_tracker::DependencyListHead<*const BindingHolder>;
type DependencyNode = dependency_tracker::DependencyNode<*const BindingHolder>; type DependencyNode = dependency_tracker::DependencyNode<*const BindingHolder>;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
use core::cell::{Cell, RefCell, UnsafeCell}; use core::cell::{Cell, RefCell, UnsafeCell};

View file

@ -1,6 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint.dev> // Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::Rc; use alloc::rc::Rc;
use core::pin::Pin; use core::pin::Pin;

View file

@ -11,6 +11,7 @@
pub type FieldOffset<T, U> = const_field_offset::FieldOffset<T, U, const_field_offset::AllowPin>; pub type FieldOffset<T, U> = const_field_offset::FieldOffset<T, U, const_field_offset::AllowPin>;
use crate::items::PropertyAnimation; use crate::items::PropertyAnimation;
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use core::convert::{TryFrom, TryInto}; use core::convert::{TryFrom, TryInto};
use core::pin::Pin; use core::pin::Pin;

View file

@ -5,6 +5,7 @@
#![allow(unsafe_code)] #![allow(unsafe_code)]
#![warn(missing_docs)] #![warn(missing_docs)]
use core::fmt::Debug; use core::fmt::Debug;
#[cfg(not(feature = "std"))]
use core::iter::FromIterator; use core::iter::FromIterator;
use core::mem::MaybeUninit; use core::mem::MaybeUninit;
use core::ops::Deref; use core::ops::Deref;

View file

@ -28,6 +28,7 @@ use crate::textlayout::{AbstractFont, FontMetrics, TextParagraphLayout};
use crate::window::{WindowAdapter, WindowInner}; use crate::window::{WindowAdapter, WindowInner};
use crate::{Brush, Color, Coord, ImageInner, StaticTextures}; use crate::{Brush, Color, Coord, ImageInner, StaticTextures};
use alloc::rc::{Rc, Weak}; use alloc::rc::{Rc, Weak};
#[cfg(not(feature = "std"))]
use alloc::{vec, vec::Vec}; use alloc::{vec, vec::Vec};
use core::cell::{Cell, RefCell}; use core::cell::{Cell, RefCell};
use core::pin::Pin; use core::pin::Pin;

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
use alloc::rc::Rc; use alloc::rc::Rc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cell::RefCell; use core::cell::RefCell;

View file

@ -7,8 +7,10 @@
#![warn(missing_docs)] #![warn(missing_docs)]
use crate::SharedVector; use crate::SharedVector;
#[cfg(not(feature = "std"))]
use alloc::string::String; use alloc::string::String;
use core::fmt::{Debug, Display, Write}; use core::fmt::{Debug, Display, Write};
#[cfg(not(feature = "std"))]
use core::iter::FromIterator; use core::iter::FromIterator;
use core::ops::Deref; use core::ops::Deref;

View file

@ -21,6 +21,7 @@
//! Emit current line as new line //! Emit current line as new line
//! //!
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use euclid::num::{One, Zero}; use euclid::num::{One, Zero};

View file

@ -1,6 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint.dev> // Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::ops::Range; use core::ops::Range;

View file

@ -10,7 +10,9 @@
*/ */
#![warn(missing_docs)] #![warn(missing_docs)]
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::{ use core::{
cell::{Cell, RefCell}, cell::{Cell, RefCell},

View file

@ -22,6 +22,7 @@ use crate::lengths::{LogicalLength, LogicalPoint, LogicalRect, SizeLengths};
use crate::properties::{Property, PropertyTracker}; use crate::properties::{Property, PropertyTracker};
use crate::renderer::Renderer; use crate::renderer::Renderer;
use crate::{Callback, Coord, SharedString}; use crate::{Callback, Coord, SharedString};
#[cfg(not(feature = "std"))]
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::rc::{Rc, Weak}; use alloc::rc::{Rc, Weak};
use core::cell::{Cell, RefCell}; use core::cell::{Cell, RefCell};

View file

@ -1,7 +1,6 @@
// Copyright © SixtyFPS GmbH <info@slint.dev> // Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
use core::convert::TryFrom;
use i_slint_compiler::diagnostics::SourceFileVersion; use i_slint_compiler::diagnostics::SourceFileVersion;
use i_slint_compiler::langtype::Type as LangType; use i_slint_compiler::langtype::Type as LangType;
use i_slint_core::component_factory::ComponentFactory; use i_slint_core::component_factory::ComponentFactory;
@ -13,7 +12,6 @@ use i_slint_core::window::WindowInner;
use i_slint_core::{PathData, SharedVector}; use i_slint_core::{PathData, SharedVector};
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::HashMap; use std::collections::HashMap;
use std::iter::FromIterator;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::rc::Rc; use std::rc::Rc;

View file

@ -3,7 +3,6 @@
use crate::{api::Value, dynamic_type, eval}; use crate::{api::Value, dynamic_type, eval};
use core::convert::TryInto;
use core::ptr::NonNull; use core::ptr::NonNull;
use dynamic_type::{Instance, InstanceBox}; use dynamic_type::{Instance, InstanceBox};
use i_slint_compiler::diagnostics::SourceFileVersion; use i_slint_compiler::diagnostics::SourceFileVersion;

View file

@ -3,7 +3,6 @@
use crate::api::{SetPropertyError, Struct, Value}; use crate::api::{SetPropertyError, Struct, Value};
use crate::dynamic_item_tree::InstanceRef; use crate::dynamic_item_tree::InstanceRef;
use core::convert::TryInto;
use core::pin::Pin; use core::pin::Pin;
use corelib::graphics::{GradientStop, LinearGradientBrush, PathElement, RadialGradientBrush}; use corelib::graphics::{GradientStop, LinearGradientBrush, PathElement, RadialGradientBrush};
use corelib::items::{ItemRef, PropertyAnimation}; use corelib::items::{ItemRef, PropertyAnimation};

View file

@ -14,7 +14,6 @@ use i_slint_core::layout::{self as core_layout};
use i_slint_core::model::RepeatedItemTree; use i_slint_core::model::RepeatedItemTree;
use i_slint_core::slice::Slice; use i_slint_core::slice::Slice;
use i_slint_core::window::WindowAdapter; use i_slint_core::window::WindowAdapter;
use std::convert::TryInto;
use std::rc::Rc; use std::rc::Rc;
use std::str::FromStr; use std::str::FromStr;