File tree Expand file tree Collapse file tree 17 files changed +20
-34
lines changed Expand file tree Collapse file tree 17 files changed +20
-34
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl Acceleration {
36
36
/// Create a new Acceleration from a floating point value in meters per second per second
37
37
pub fn from_meters_per_second_per_second ( meters_per_second_per_second : f64 ) -> Acceleration {
38
38
Acceleration {
39
- meters_per_second_per_second : meters_per_second_per_second ,
39
+ meters_per_second_per_second,
40
40
}
41
41
}
42
42
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl Angle {
33
33
34
34
/// Create a new Angle from a floating point value in radians
35
35
pub fn from_radians ( radians : f64 ) -> Self {
36
- Angle { radians : radians }
36
+ Angle { radians }
37
37
}
38
38
39
39
/// Convert this Angle to a floating point value in degrees
Original file line number Diff line number Diff line change @@ -27,9 +27,7 @@ pub struct AngularVelocity {
27
27
impl AngularVelocity {
28
28
/// Create a new AngularVelocity from a floating point value in radians per second
29
29
pub fn from_radians_per_second ( radians_per_second : f64 ) -> Self {
30
- AngularVelocity {
31
- radians_per_second : radians_per_second,
32
- }
30
+ AngularVelocity { radians_per_second }
33
31
}
34
32
35
33
/// Create a new AngularVelocity from a floating point value in revolutions per minute (RPM)
Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ pub struct Area {
31
31
impl Area {
32
32
/// Create new area from floating point value in Square Meters
33
33
pub fn from_square_meters ( square_meters : f64 ) -> Self {
34
- Area {
35
- square_meters : square_meters,
36
- }
34
+ Area { square_meters }
37
35
}
38
36
39
37
/// Create new area from floating point value in Square Metres
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ pub struct Data {
38
38
impl Data {
39
39
/// Create new Data from floating point value in Octets
40
40
pub fn from_octets ( octets : f64 ) -> Self {
41
- Data { octets : octets }
41
+ Data { octets }
42
42
}
43
43
44
44
/// Create new Data from floating point value in Bits
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ impl Density {
53
53
/// Create a new Density from a floating point value in kilograms per cubic meter
54
54
pub fn from_kilograms_per_cubic_meter ( kilograms_per_cubic_meter : f64 ) -> Density {
55
55
Density {
56
- kilograms_per_cubic_meter : kilograms_per_cubic_meter ,
56
+ kilograms_per_cubic_meter,
57
57
}
58
58
}
59
59
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub struct Energy {
22
22
impl Energy {
23
23
/// Create a new Energy from a floating point value in Joules (or watt-seconds)
24
24
pub fn from_joules ( joules : f64 ) -> Energy {
25
- Energy { joules : joules }
25
+ Energy { joules }
26
26
}
27
27
28
28
/// Create a new Energy from a floating point value in Kilocalories (often just called calories)
@@ -37,7 +37,7 @@ impl Energy {
37
37
38
38
/// Create a new Energy from a floating point value in electron Volts (eV).
39
39
pub fn from_e_v ( e_v : f64 ) -> Energy {
40
- Self :: from_joules ( e_v / 6.241509479607718e+18 )
40
+ Self :: from_joules ( e_v / 6.241_509_479_607_718e18 )
41
41
}
42
42
43
43
/// Create a new Energy from a floating point value in Watt-hours (Wh)
@@ -67,7 +67,7 @@ impl Energy {
67
67
68
68
/// Convert this Energy into a floating point value in electron volts (eV)
69
69
pub fn as_e_v ( & self ) -> f64 {
70
- self . joules * 6.241509479607718e+18
70
+ self . joules * 6.241_509_479_607_718e18
71
71
}
72
72
73
73
/// Convert this Energy into a floating point value in Watt-hours (Wh)
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ pub struct Force {
37
37
impl Force {
38
38
/// Create a Force from a floating point value in Newtons
39
39
pub fn from_newtons ( newtons : f64 ) -> Self {
40
- Force { newtons : newtons }
40
+ Force { newtons }
41
41
}
42
42
43
43
/// Create a Force from a floating point value in Micronewtons
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ pub type Distance = Frequency;
41
41
impl Frequency {
42
42
/// Create a new Frequency from a floating point value in hertz
43
43
pub fn from_hertz ( hertz : f64 ) -> Self {
44
- Frequency { hertz : hertz }
44
+ Frequency { hertz }
45
45
}
46
46
47
47
/// Create a new Frequency from a floating point value in Nanohertz.
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ pub type Distance = Length;
56
56
impl Length {
57
57
/// Create a new Length from a floating point value in meters
58
58
pub fn from_meters ( meters : f64 ) -> Self {
59
- Length { meters : meters }
59
+ Length { meters }
60
60
}
61
61
62
62
/// Create a new Length from a floating point value in metres.
You can’t perform that action at this time.
0 commit comments