@@ -12,8 +12,8 @@ use bevy_sprite::BorderRect;
12
12
use bevy_utils:: warn_once;
13
13
use bevy_window:: { PrimaryWindow , WindowRef } ;
14
14
use core:: num:: NonZero ;
15
+ use derive_more:: derive:: { Display , Error , From } ;
15
16
use smallvec:: SmallVec ;
16
- use thiserror:: Error ;
17
17
18
18
/// Base component for a UI node, which also provides the computed size of the node.
19
19
///
@@ -1333,7 +1333,7 @@ impl Default for GridTrack {
1333
1333
}
1334
1334
}
1335
1335
1336
- #[ derive( Copy , Clone , PartialEq , Debug , Reflect ) ]
1336
+ #[ derive( Copy , Clone , PartialEq , Debug , Reflect , From ) ]
1337
1337
#[ reflect( Default , PartialEq ) ]
1338
1338
#[ cfg_attr(
1339
1339
feature = "serialize" ,
@@ -1363,12 +1363,6 @@ impl Default for GridTrackRepetition {
1363
1363
}
1364
1364
}
1365
1365
1366
- impl From < u16 > for GridTrackRepetition {
1367
- fn from ( count : u16 ) -> Self {
1368
- Self :: Count ( count)
1369
- }
1370
- }
1371
-
1372
1366
impl From < i32 > for GridTrackRepetition {
1373
1367
fn from ( count : i32 ) -> Self {
1374
1368
Self :: Count ( count as u16 )
@@ -1784,11 +1778,11 @@ fn try_into_grid_span(span: u16) -> Result<Option<NonZero<u16>>, GridPlacementEr
1784
1778
}
1785
1779
1786
1780
/// Errors that occur when setting constraints for a `GridPlacement`
1787
- #[ derive( Debug , Eq , PartialEq , Clone , Copy , Error ) ]
1781
+ #[ derive( Debug , Eq , PartialEq , Clone , Copy , Error , Display ) ]
1788
1782
pub enum GridPlacementError {
1789
- #[ error ( "Zero is not a valid grid position" ) ]
1783
+ #[ display ( "Zero is not a valid grid position" ) ]
1790
1784
InvalidZeroIndex ,
1791
- #[ error ( "Spans cannot be zero length" ) ]
1785
+ #[ display ( "Spans cannot be zero length" ) ]
1792
1786
InvalidZeroSpan ,
1793
1787
}
1794
1788
0 commit comments