@@ -66,7 +66,7 @@ macro_rules! impl_set_size {
66
66
& mut self ,
67
67
w: i32 ,
68
68
h: i32 ,
69
- ) -> Result <( ) , Box <dyn std :: error :: Error > > {
69
+ ) -> Result <( ) , stretch :: Error > {
70
70
self . stretch_context. set_measure(
71
71
self . $name,
72
72
Some ( new_measure_func_with_min_sizes( w as f32 , h as f32 ) ) ,
@@ -83,7 +83,7 @@ macro_rules! impl_set_size {
83
83
& mut self ,
84
84
w: i32 ,
85
85
h: i32 ,
86
- ) -> Result <( ) , Box <dyn std :: error :: Error > > {
86
+ ) -> Result <( ) , stretch :: Error > {
87
87
self . stretch_context. set_measure(
88
88
self . $name. $sub_part,
89
89
Some ( new_measure_func_with_min_sizes( w as f32 , h as f32 ) ) ,
@@ -106,7 +106,7 @@ pub(crate) struct CenteredLabelLayout {
106
106
impl CenteredLabelLayout {
107
107
/// Create an inner node that is `justify-content: center` with respect
108
108
/// to its outer node.
109
- fn new ( stretch_context : & mut Stretch ) -> Result < Self , Box < dyn std :: error :: Error > > {
109
+ fn new ( stretch_context : & mut Stretch ) -> Result < Self , stretch :: Error > {
110
110
let inner = stretch_context. new_leaf (
111
111
Default :: default ( ) ,
112
112
Box :: new ( |constraint| {
@@ -127,7 +127,7 @@ impl CenteredLabelLayout {
127
127
Ok ( Self { inner, outer } )
128
128
}
129
129
/// Create an inner node that is horizontally centered in its 100% width parent.
130
- fn new_row_layout ( stretch_context : & mut Stretch ) -> Result < Self , Box < dyn std :: error :: Error > > {
130
+ fn new_row_layout ( stretch_context : & mut Stretch ) -> Result < Self , stretch :: Error > {
131
131
let layout = Self :: new ( stretch_context) ?;
132
132
// If the layout is placed in a row, the outer should have 100% width.
133
133
let outer_style = * stretch_context. style ( layout. outer ) ?;
@@ -142,7 +142,7 @@ impl CenteredLabelLayout {
142
142
Ok ( layout)
143
143
}
144
144
/// Create an inner node that is vertically centered in its 100% height parent.
145
- fn new_col_layout ( stretch_context : & mut Stretch ) -> Result < Self , Box < dyn std :: error :: Error > > {
145
+ fn new_col_layout ( stretch_context : & mut Stretch ) -> Result < Self , stretch :: Error > {
146
146
let layout = Self :: new ( stretch_context) ?;
147
147
// If the layout is placed in a row, the outer should have 100% width.
148
148
let outer_style = * stretch_context. style ( layout. outer ) ?;
@@ -232,7 +232,7 @@ pub(crate) struct ChartLayoutNodes {
232
232
impl ChartLayoutNodes {
233
233
/// Create a new `ChartLayoutNodes`. All margins/padding/sizes are set to 0
234
234
/// and should be overridden as needed.
235
- pub fn new ( ) -> Result < Self , Box < dyn std :: error :: Error > > {
235
+ pub fn new ( ) -> Result < Self , stretch :: Error > {
236
236
// Set up the layout engine
237
237
let mut stretch_context = Stretch :: new ( ) ;
238
238
@@ -312,7 +312,7 @@ impl ChartLayoutNodes {
312
312
}
313
313
/// Compute the layout of all items to fill a container of width
314
314
/// `w` and height `h`.
315
- pub fn layout ( & mut self , w : u32 , h : u32 ) -> Result < ( ) , Box < dyn std :: error :: Error > > {
315
+ pub fn layout ( & mut self , w : u32 , h : u32 ) -> Result < ( ) , stretch :: Error > {
316
316
// Compute the initial layout
317
317
self . stretch_context . compute_layout (
318
318
self . outer_container ,
@@ -381,7 +381,7 @@ impl ChartLayoutNodes {
381
381
& mut self ,
382
382
w : i32 ,
383
383
h : i32 ,
384
- ) -> Result < ( ) , Box < dyn std :: error :: Error > > {
384
+ ) -> Result < ( ) , stretch :: Error > {
385
385
self . stretch_context . set_measure (
386
386
self . chart_area ,
387
387
Some ( new_measure_func_with_min_sizes ( w as f32 , h as f32 ) ) ,
@@ -420,7 +420,7 @@ impl ChartLayoutNodes {
420
420
fn packed_title_label_area (
421
421
stretch_context : & mut Stretch ,
422
422
flex_direction : FlexDirection ,
423
- ) -> Result < ( Node , CenteredLabelLayout , Node ) , Box < dyn std :: error :: Error > > {
423
+ ) -> Result < ( Node , CenteredLabelLayout , Node ) , stretch :: Error > {
424
424
let title = match flex_direction {
425
425
FlexDirection :: Row | FlexDirection :: RowReverse => {
426
426
// If the title and the label are packed in a row, the title should be centered in a *column*.
0 commit comments