Skip to content

Commit fdd2c3e

Browse files
committed
Ran cargo fmt.
1 parent 897252f commit fdd2c3e

File tree

7 files changed

+22
-28
lines changed

7 files changed

+22
-28
lines changed

examples/format_test.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use measurements::Pressure;
55
use measurements::Volume;
66
use measurements::Weight;
77
fn main() {
8-
for power in -9..9 {
9-
let val: f64 = 123.456 * (10.0f64.powf(power as f64));
10-
println!("10^{}...", power);
11-
println!("Temp of {0:.3} outside", Temperature::from_kelvin(val));
12-
println!("Distance of {0:.3}", Length::from_meters(val));
13-
println!("Pressure of {0:.3}", Pressure::from_millibars(val));
14-
println!("Volume of {0:.3}", Volume::from_litres(val));
15-
println!("Weight of {0:.3}", Weight::from_kilograms(val));
16-
}
8+
for power in -9..9 {
9+
let val: f64 = 123.456 * (10.0f64.powf(power as f64));
10+
println!("10^{}...", power);
11+
println!("Temp of {0:.3} outside", Temperature::from_kelvin(val));
12+
println!("Distance of {0:.3}", Length::from_meters(val));
13+
println!("Pressure of {0:.3}", Pressure::from_millibars(val));
14+
println!("Volume of {0:.3}", Volume::from_litres(val));
15+
println!("Weight of {0:.3}", Weight::from_kilograms(val));
16+
}
1717
}

src/length.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ impl Measurement for Length {
173173
("m", self.meters)
174174
}
175175
}
176-
177176
}
178177

179178
implement_measurement! { Length }
180-

src/measurement.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ macro_rules! implement_measurement {
106106
}
107107
}
108108

109-
// Multiplying a `$t` by another `$t` returns the product of those measurements.
110-
//
109+
// Multiplying a `$t` by another `$t` returns the product of those
110+
// measurements.
111111
impl ::std::ops::Mul<$t> for $t {
112112
type Output = Self;
113113

@@ -116,8 +116,8 @@ macro_rules! implement_measurement {
116116
}
117117
}
118118

119-
// Multiplying a `$t` by a factor increases (or decreases) that measurement a number of times.
120-
//
119+
// Multiplying a `$t` by a factor increases (or decreases) that
120+
// measurement a number of times.
121121
impl ::std::ops::Mul<f64> for $t {
122122
type Output = Self;
123123

src/pressure.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,3 @@ impl Measurement for Pressure {
9898
}
9999

100100
implement_measurement! { Pressure }
101-

src/temperature.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ impl TemperatureDelta {
4444
}
4545

4646
pub fn from_fahrenheit(farenheit_degrees: f64) -> Self {
47-
TemperatureDelta { kelvin_degrees: farenheit_degrees / 1.8}
47+
TemperatureDelta { kelvin_degrees: farenheit_degrees / 1.8 }
4848
}
4949

5050
pub fn from_rankine(rankine_degrees: f64) -> Self {
51-
TemperatureDelta { kelvin_degrees: rankine_degrees / 1.8}
51+
TemperatureDelta { kelvin_degrees: rankine_degrees / 1.8 }
5252
}
5353

5454
pub fn as_kelvin(&self) -> f64 {
@@ -114,7 +114,6 @@ impl Measurement for Temperature {
114114
fn get_base_units_name(&self) -> &'static str {
115115
"K"
116116
}
117-
118117
}
119118

120119
impl Measurement for TemperatureDelta {
@@ -155,7 +154,7 @@ impl ::std::ops::Sub<Temperature> for Temperature {
155154
}
156155
}
157156

158-
impl ::std::cmp::Eq for Temperature { }
157+
impl ::std::cmp::Eq for Temperature {}
159158
impl ::std::cmp::PartialEq for Temperature {
160159
fn eq(&self, other: &Self) -> bool {
161160
self.get_base_units() == other.get_base_units()
@@ -168,7 +167,7 @@ impl ::std::cmp::PartialOrd for Temperature {
168167
}
169168
}
170169

171-
impl ::std::cmp::Eq for TemperatureDelta { }
170+
impl ::std::cmp::Eq for TemperatureDelta {}
172171
impl ::std::cmp::PartialEq for TemperatureDelta {
173172
fn eq(&self, other: &Self) -> bool {
174173
self.kelvin_degrees == other.kelvin_degrees
@@ -181,5 +180,5 @@ impl ::std::cmp::PartialOrd for TemperatureDelta {
181180
}
182181
}
183182

184-
implement_display!( Temperature );
185-
implement_display!( TemperatureDelta );
183+
implement_display!(Temperature);
184+
implement_display!(TemperatureDelta);

src/volume.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ impl Measurement for Volume {
221221
("l", self.litres)
222222
}
223223
}
224-
225224
}
226225

227226
implement_measurement! { Volume }
228-

src/weight.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use super::measurement::*;
1010
/// let metric_ton = Weight::from_metric_tons(1.0);
1111
/// let united_states_tons = metric_ton.as_short_tons();
1212
/// let united_states_pounds = metric_ton.as_pounds();
13-
/// println!("One metric ton is {} U.S. tons - that's {} pounds!", united_states_tons, united_states_pounds);
13+
/// println!(
14+
/// "One metric ton is {} U.S. tons - that's {} pounds!",
15+
/// united_states_tons, united_states_pounds);
1416
/// ```
1517
#[derive(Copy, Clone, Debug)]
1618
pub struct Weight {
@@ -169,8 +171,6 @@ impl Measurement for Weight {
169171
("kg", self.kilograms)
170172
}
171173
}
172-
173174
}
174175

175176
implement_measurement! { Weight }
176-

0 commit comments

Comments
 (0)