@@ -42,7 +42,7 @@ pub trait MassBalance {
4242 let mass_in_kg = mass_in. get :: < kilogram > ( ) ;
4343 let mass_out_kg = mass_out. get :: < kilogram > ( ) ;
4444 let mass_difference = mass_in_kg - mass_out_kg;
45- return mass_difference <= TOLERENCE_MASS . get :: < kilogram > ( ) ;
45+ mass_difference <= TOLERENCE_MASS . get :: < kilogram > ( )
4646 }
4747}
4848
@@ -62,9 +62,7 @@ pub trait EnergyBalance {
6262 let energy_in_joules = energy_in. get :: < joule > ( ) ;
6363 let energy_out_joules = energy_out. get :: < joule > ( ) ;
6464 let energy_difference = energy_in_joules - energy_out_joules;
65- let within_threshold = energy_difference <=
66- TOLERENCE_ENERGY . get :: < joule > ( ) ;
67- return within_threshold;
65+ energy_difference <= TOLERENCE_ENERGY . get :: < joule > ( )
6866 }
6967}
7068
@@ -106,15 +104,15 @@ impl Mixer {
106104 in_streams_mass : Vec < connector:: Mconnector > ,
107105 in_streams_energy : Vec < connector:: Econnector > ,
108106 ) -> Mixer {
109- return Mixer {
107+ Mixer {
110108 block_id : id,
111109 x_cord,
112110 y_cord,
113111 input_streams_mass : in_streams_mass,
114112 input_streams_energy : in_streams_energy,
115113 outlet_stream_mass : None ,
116114 outlet_stream_energy : None ,
117- } ;
115+ }
118116 }
119117
120118 /// Execute the mixer block (calculate balances, output streams, etc)
@@ -143,19 +141,19 @@ impl Mixer {
143141 let mut mass_flow_sum: f64 = 0.0 ;
144142
145143 for stream in & self . input_streams_mass {
146- mass_flow_sum = mass_flow_sum + stream. m_flow_total ;
144+ mass_flow_sum += stream. m_flow_total ;
147145 }
148- return Some ( mass_flow_sum) ;
146+ Some ( mass_flow_sum)
149147 }
150148
151149 /// Determines the total energy flowing through the block
152150 fn compute_outlet_energy_flows ( & self ) -> Option < f64 > {
153151 let mut energy_flow_sum: f64 = 0.0 ;
154152
155153 for stream in & self . input_streams_energy {
156- energy_flow_sum = energy_flow_sum + stream. energy_flow_total ;
154+ energy_flow_sum += stream. energy_flow_total ;
157155 }
158- return Some ( energy_flow_sum) ;
156+ Some ( energy_flow_sum)
159157 }
160158
161159 /// Determines the phase fractions of the output using thermodynamics.
0 commit comments