Skip to content

Commit 985e1ac

Browse files
cargo fmt
1 parent e15cac5 commit 985e1ac

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

rust/crates/sift_cli/src/cmd/import/hdf5/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
use std::path::PathBuf;
22

3-
use chrono::DateTime;
4-
use hdf5::types::{EnumMember, EnumType, FloatSize, IntSize, TypeDescriptor};
5-
use sift_rs::common::r#type::v1::{ ChannelDataType, ChannelConfig };
6-
use sift_rs::data_imports::v2::TimeFormat as ProtoTimeFormat;
73
use crate::cli::hdf5::Hdf5Schema;
84
use crate::cli::time::TimeFormat;
95
use crate::cli::{CommonImportArgs, ImportHdf5Args};
@@ -13,6 +9,10 @@ use crate::cmd::import::hdf5::detect_hdf5_schema::{
139
};
1410
use crate::cmd::import::hdf5::import::build_hdf5_config;
1511
use crate::cmd::import::utils::group_path_to_channel_name;
12+
use chrono::DateTime;
13+
use hdf5::types::{EnumMember, EnumType, FloatSize, IntSize, TypeDescriptor};
14+
use sift_rs::common::r#type::v1::{ChannelConfig, ChannelDataType};
15+
use sift_rs::data_imports::v2::TimeFormat as ProtoTimeFormat;
1616

1717
fn make_args() -> ImportHdf5Args {
1818
ImportHdf5Args {

rust/crates/sift_cli/src/cmd/import/tdms/detect_tdms_config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,11 @@ fn detect_config(path: &Path, fallback_method: TdmsFallbackMethod) -> Result<Vec
212212
let channels = file.channels(&group).into_iter().collect::<Vec<_>>();
213213
let time_channel_name = find_time_channel(&channels);
214214

215-
if let Some(time_name) = time_channel_name.as_ref() && let Some((_, time_channel)) = channels.iter().find(|(n, _)| n == time_name) {
216-
let time_dt = tdms_to_sift_data_type(time_channel.data_type)
217-
.unwrap_or(ChannelDataType::Int64);
215+
if let Some(time_name) = time_channel_name.as_ref()
216+
&& let Some((_, time_channel)) = channels.iter().find(|(n, _)| n == time_name)
217+
{
218+
let time_dt =
219+
tdms_to_sift_data_type(time_channel.data_type).unwrap_or(ChannelDataType::Int64);
218220
channels_vec.push(ChannelConfig {
219221
name: format!("{group}.{time_name}"),
220222
description: "[time]".into(),

0 commit comments

Comments
 (0)