From d5ff97f42ed1e682a66ea8d51e5f9ed1be547b9c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 2 Aug 2020 16:56:14 +0200 Subject: =?UTF-8?q?Move=20binary=20into=20separate=20crate=20and=20tidy=20?= =?UTF-8?q?dependencies=20=F0=9F=8E=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/layout/mod.rs') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 510f504a..64a2825b 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1,10 +1,11 @@ //! Layouting types and engines. use std::fmt::{self, Display, Formatter}; -use smallvec::SmallVec; + +#[cfg(feature = "serialize")] use serde::Serialize; -use fontdock::FaceId; +use fontdock::FaceId; use crate::geom::{Size, Margins}; use self::prelude::*; @@ -31,12 +32,13 @@ pub mod prelude { pub type MultiLayout = Vec; /// A finished box with content at fixed positions. -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "serialize", derive(Serialize))] pub struct Layout { /// The size of the box. pub dimensions: Size, /// How to align this layout in a parent container. - #[serde(skip)] + #[cfg_attr(feature = "serialize", serde(skip))] pub align: LayoutAlign, /// The actions composing this layout. pub actions: Vec, @@ -59,7 +61,7 @@ impl Layout { /// A vector of layout spaces, that is stack allocated as long as it only /// contains at most 2 spaces. -pub type LayoutSpaces = SmallVec<[LayoutSpace; 2]>; +pub type LayoutSpaces = Vec; /// The space into which content is laid out. #[derive(Debug, Copy, Clone, PartialEq)] -- cgit v1.2.3