Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Mar 10, 2022
1 parent fb3e040 commit 2c8974f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions crates/kas-core/src/theme/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,11 @@ impl<'a> std::ops::BitOrAssign<TkAction> for DrawMgr<'a> {
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
#[autoimpl(for<H: trait + ?Sized> Box<H>)]
#[cfg(feature = "stack_dst")]
#[autoimpl(
#[cfg_attr(feature = "stack_dst", autoimpl(
for<'a, S: Default + Copy + AsRef<[usize]> + AsMut<[usize]>>
stack_dst::ValueA<dyn DrawHandle + 'a, S>
using dyn DrawHandle
)]
))]
pub trait DrawHandle {
/// Access components: [`SizeHandle`], [`DrawShared`], [`EventState`]
fn components(&mut self) -> (&dyn SizeHandle, &mut dyn DrawShared, &mut EventState);
Expand Down
3 changes: 2 additions & 1 deletion crates/kas-core/src/theme/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ use super::DrawMgr;
use super::{FrameStyle, TextClass};
use crate::geom::Size;
use crate::layout::{AxisInfo, FrameRules, Margins, SizeRules};
use crate::macros::autoimpl;
use crate::text::TextApi;

// for doc use
use crate::macros::autoimpl;
#[allow(unused)]
use crate::text::TextApiExt;

Expand Down
9 changes: 3 additions & 6 deletions crates/kas-core/src/updatable/data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use std::fmt::Debug;
/// Trait for viewable single data items
// Note: we require Debug + 'static to allow widgets using this to implement
// WidgetCore, which requires Debug + Any.
#[autoimpl(for<T: trait + ?Sized> &T, &mut T)]
#[autoimpl(for<T: trait + ?Sized> std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
#[autoimpl(for<T: trait + ?Sized> &T, &mut T, std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
pub trait SingleData: Debug {
/// Output type
type Item: Clone;
Expand Down Expand Up @@ -76,8 +75,7 @@ pub trait SingleDataMut: SingleData {

/// Trait for viewable data lists
#[allow(clippy::len_without_is_empty)]
#[autoimpl(for<T: trait + ?Sized> &T, &mut T)]
#[autoimpl(for<T: trait + ?Sized> std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
#[autoimpl(for<T: trait + ?Sized> &T, &mut T, std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
pub trait ListData: Debug {
/// Key type
type Key: Clone + Debug + PartialEq + Eq;
Expand Down Expand Up @@ -177,8 +175,7 @@ pub trait ListDataMut: ListData {
/// Trait for viewable data matrices
///
/// Data matrices are a kind of table where each cell has the same type.
#[autoimpl(for<T: trait + ?Sized> &T, &mut T)]
#[autoimpl(for<T: trait + ?Sized> std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
#[autoimpl(for<T: trait + ?Sized> &T, &mut T, std::rc::Rc<T>, std::sync::Arc<T>, Box<T>)]
pub trait MatrixData: Debug {
/// Column key type
type ColKey: Clone + Debug + PartialEq + Eq;
Expand Down

0 comments on commit 2c8974f

Please sign in to comment.