Skip to content

Commit

Permalink
Flag lazy feature types directly
Browse files Browse the repository at this point in the history
Co-authored-by: JL710 <example@examples.com>
  • Loading branch information
hecrj and JL710 committed Sep 5, 2024
1 parent 14e686c commit 561b754
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions widget/src/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use std::hash::{Hash, Hasher as H};
use std::rc::Rc;

/// A widget that only rebuilds its contents when necessary.
#[cfg(feature = "lazy")]
#[allow(missing_debug_implementations)]
pub struct Lazy<'a, Message, Theme, Renderer, Dependency, View> {
dependency: Dependency,
Expand Down
1 change: 1 addition & 0 deletions widget/src/lazy/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use std::rc::Rc;
///
/// Additionally, a [`Component`] is capable of producing a `Message` to notify
/// the parent application of any relevant interactions.
#[cfg(feature = "lazy")]
pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
/// The internal state of this [`Component`].
type State: Default;
Expand Down
5 changes: 3 additions & 2 deletions widget/src/lazy/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::core::{self, Element, Size};
use crate::lazy::component::{self, Component};
use crate::lazy::{Lazy, Responsive};
use crate::lazy::component;

use std::hash::Hash;

pub use crate::lazy::{Component, Lazy, Responsive};

/// Creates a new [`Lazy`] widget with the given data `Dependency` and a
/// closure that can turn this data into a widget tree.
#[cfg(feature = "lazy")]
Expand Down
1 change: 1 addition & 0 deletions widget/src/lazy/responsive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::ops::Deref;
///
/// A [`Responsive`] widget will always try to fill all the available space of
/// its parent.
#[cfg(feature = "lazy")]
#[allow(missing_debug_implementations)]
pub struct Responsive<
'a,
Expand Down
3 changes: 0 additions & 3 deletions widget/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ pub use helpers::*;
#[cfg(feature = "lazy")]
mod lazy;

#[cfg(feature = "lazy")]
pub use crate::lazy::{Component, Lazy, Responsive};

#[cfg(feature = "lazy")]
pub use crate::lazy::helpers::*;

Expand Down

0 comments on commit 561b754

Please sign in to comment.