File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,31 +45,31 @@ impl AspectRatio {
45
45
46
46
/// Returns the aspect ratio as a f32 value.
47
47
#[ inline]
48
- pub fn ratio ( & self ) -> f32 {
48
+ pub const fn ratio ( & self ) -> f32 {
49
49
self . 0
50
50
}
51
51
52
52
/// Returns the inverse of this aspect ratio (height/width).
53
53
#[ inline]
54
- pub fn inverse ( & self ) -> Self {
54
+ pub const fn inverse ( & self ) -> Self {
55
55
Self ( 1.0 / self . 0 )
56
56
}
57
57
58
58
/// Returns true if the aspect ratio represents a landscape orientation.
59
59
#[ inline]
60
- pub fn is_landscape ( & self ) -> bool {
60
+ pub const fn is_landscape ( & self ) -> bool {
61
61
self . 0 > 1.0
62
62
}
63
63
64
64
/// Returns true if the aspect ratio represents a portrait orientation.
65
65
#[ inline]
66
- pub fn is_portrait ( & self ) -> bool {
66
+ pub const fn is_portrait ( & self ) -> bool {
67
67
self . 0 < 1.0
68
68
}
69
69
70
70
/// Returns true if the aspect ratio is exactly square.
71
71
#[ inline]
72
- pub fn is_square ( & self ) -> bool {
72
+ pub const fn is_square ( & self ) -> bool {
73
73
self . 0 == 1.0
74
74
}
75
75
}
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ impl Rot2 {
350
350
#[ inline]
351
351
#[ must_use]
352
352
#[ doc( alias = "conjugate" ) ]
353
- pub fn inverse ( self ) -> Self {
353
+ pub const fn inverse ( self ) -> Self {
354
354
Self {
355
355
cos : self . cos ,
356
356
sin : -self . sin ,
You can’t perform that action at this time.
0 commit comments