Skip to content

Commit 8f1d742

Browse files
committed
style: rustfmt on changes
1 parent 2cd51e2 commit 8f1d742

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

vm/src/primitives.rs

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,59 +171,74 @@ mod int {
171171
if divisor != 0 {
172172
RuntimeResult::Return(dividend % divisor)
173173
} else {
174-
RuntimeResult::Panic(
175-
format!("attempted to calculate remainder of {} divided by 0", dividend)
176-
)
174+
RuntimeResult::Panic(format!(
175+
"attempted to calculate remainder of {} divided by 0",
176+
dividend
177+
))
177178
}
178179
}
179180

180181
pub(crate) fn rem_euclid(dividend: VmInt, divisor: VmInt) -> RuntimeResult<VmInt, String> {
181182
if divisor != 0 {
182183
RuntimeResult::Return(dividend.rem_euclid(divisor))
183184
} else {
184-
RuntimeResult::Panic(
185-
format!("attempted to calculate euclidean remainder of {} divided by 0", dividend)
186-
)
185+
RuntimeResult::Panic(format!(
186+
"attempted to calculate euclidean remainder of {} divided by 0",
187+
dividend
188+
))
187189
}
188190
}
189191

190192
pub(crate) fn wrapping_rem(dividend: VmInt, divisor: VmInt) -> RuntimeResult<VmInt, String> {
191193
if divisor != 0 {
192194
RuntimeResult::Return(dividend.wrapping_rem(divisor))
193195
} else {
194-
RuntimeResult::Panic(
195-
format!("attempted to calculate wrapping remainder of {} divided by 0", dividend)
196-
)
196+
RuntimeResult::Panic(format!(
197+
"attempted to calculate wrapping remainder of {} divided by 0",
198+
dividend
199+
))
197200
}
198201
}
199202

200-
pub(crate) fn wrapping_rem_euclid(dividend: VmInt, divisor: VmInt) -> RuntimeResult<VmInt, String> {
203+
pub(crate) fn wrapping_rem_euclid(
204+
dividend: VmInt,
205+
divisor: VmInt,
206+
) -> RuntimeResult<VmInt, String> {
201207
if divisor != 0 {
202208
RuntimeResult::Return(dividend.wrapping_rem_euclid(divisor))
203209
} else {
204-
RuntimeResult::Panic(
205-
format!("attempted to calculate wrapping euclidean remainder of {} divided by 0", dividend)
206-
)
210+
RuntimeResult::Panic(format!(
211+
"attempted to calculate wrapping euclidean remainder of {} divided by 0",
212+
dividend
213+
))
207214
}
208215
}
209216

210-
pub(crate) fn overflowing_rem(dividend: VmInt, divisor: VmInt) -> RuntimeResult<(VmInt, bool), String> {
217+
pub(crate) fn overflowing_rem(
218+
dividend: VmInt,
219+
divisor: VmInt,
220+
) -> RuntimeResult<(VmInt, bool), String> {
211221
if divisor != 0 {
212222
RuntimeResult::Return(dividend.overflowing_rem(divisor))
213223
} else {
214-
RuntimeResult::Panic(
215-
format!("attempted to calculate overflowing remainder of {} divided by 0", dividend)
216-
)
224+
RuntimeResult::Panic(format!(
225+
"attempted to calculate overflowing remainder of {} divided by 0",
226+
dividend
227+
))
217228
}
218229
}
219230

220-
pub(crate) fn overflowing_rem_euclid(dividend: VmInt, divisor: VmInt) -> RuntimeResult<(VmInt, bool), String> {
231+
pub(crate) fn overflowing_rem_euclid(
232+
dividend: VmInt,
233+
divisor: VmInt,
234+
) -> RuntimeResult<(VmInt, bool), String> {
221235
if divisor != 0 {
222236
RuntimeResult::Return(dividend.overflowing_rem_euclid(divisor))
223237
} else {
224-
RuntimeResult::Panic(
225-
format!("attempted to calculate overflowing euclidean remainder of {} divided by 0", dividend)
226-
)
238+
RuntimeResult::Panic(format!(
239+
"attempted to calculate overflowing euclidean remainder of {} divided by 0",
240+
dividend
241+
))
227242
}
228243
}
229244
}

0 commit comments

Comments
 (0)