Skip to content

Commit 6fab0d1

Browse files
committed
chore: formatting.
1 parent 078201a commit 6fab0d1

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

hftbacktest/src/backtest/data/npy/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,19 @@ mod s3_support {
212212
.await
213213
.map_err(|e| Error::other(format!("S3 request failed: {e}")))?;
214214

215-
let bytes = response.body.collect().await.map_err(|e| {
216-
Error::other(format!("Failed to read response body: {e}"))
217-
})?;
215+
let bytes = response
216+
.body
217+
.collect()
218+
.await
219+
.map_err(|e| Error::other(format!("Failed to read response body: {e}")))?;
218220

219221
Ok(bytes.into_bytes().to_vec())
220222
}
221223

222224
pub fn read_s3_object(s3_path: &str) -> std::io::Result<Vec<u8>> {
223225
// Create runtime
224-
let rt = tokio::runtime::Runtime::new().map_err(|e| {
225-
Error::other(format!("Failed to create runtime: {e}"))
226-
})?;
226+
let rt = tokio::runtime::Runtime::new()
227+
.map_err(|e| Error::other(format!("Failed to create runtime: {e}")))?;
227228

228229
rt.block_on(read_s3_object_async(s3_path))
229230
}

hftbacktest/src/depth/roivectormarketdepth.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ impl ROIVectorMarketDepth {
123123

124124
/// Returns the lower and the upper bound of the range of interest, in price.
125125
pub fn roi(&self) -> (f64, f64) {
126-
(self.roi_lb as f64 * self.tick_size, self.roi_ub as f64 * self.tick_size)
126+
(
127+
self.roi_lb as f64 * self.tick_size,
128+
self.roi_ub as f64 * self.tick_size,
129+
)
127130
}
128131

129132
/// Returns the lower and the upper bound of the range of interest, in ticks.

py-hftbacktest/src/depth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ pub extern "C" fn roivecdepth_roi_lb_tick(ptr: *const ROIVectorMarketDepth) -> i
192192
pub extern "C" fn roivecdepth_roi_ub_tick(ptr: *const ROIVectorMarketDepth) -> i64 {
193193
let depth = unsafe { &*ptr };
194194
depth.roi_tick().1
195-
}
195+
}

py-hftbacktest/src/fuse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use hftbacktest::{
55
prelude::Event,
66
types::{
77
BUY_EVENT,
8+
DEPTH_BBO_EVENT,
89
DEPTH_CLEAR_EVENT,
910
DEPTH_EVENT,
1011
DEPTH_SNAPSHOT_EVENT,
11-
DEPTH_BBO_EVENT,
1212
SELL_EVENT,
1313
Side,
1414
},

0 commit comments

Comments
 (0)