Skip to content

Commit

Permalink
Merge pull request #16 from JeromeSchmied/cosmetics
Browse files Browse the repository at this point in the history
refactor: cosmetics
  • Loading branch information
JeromeSchmied authored Jan 24, 2025
2 parents 9381056 + 37f0c03 commit 3783607
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
17 changes: 7 additions & 10 deletions src/fit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use time::OffsetDateTime;
#[derive(Default, Clone)]
pub struct Fit {
pub file_name: PathBuf,
num_records_processed: u16,
pub track_segment: TrackSegment,
}

Expand Down Expand Up @@ -126,17 +125,15 @@ impl Fit {
fields: Vec<FitFieldValue>,
data: &mut Fit,
) {
if global_message_num == fit_file::GLOBAL_MSG_NUM_SESSION {
// let msg = FitSessionMsg::new(fields);
// let sport_names = fit_file::init_sport_name_map();
// let sport_id = msg.sport.unwrap();

// println!("Sport: {}", sport_names.get(&sport_id).unwrap());
} else if global_message_num == fit_file::GLOBAL_MSG_NUM_RECORD {
// if global_message_num == fit_file::GLOBAL_MSG_NUM_SESSION {
// let msg = FitSessionMsg::new(fields);
// let sport_names = fit_file::init_sport_name_map();
// let sport_id = msg.sport.unwrap();
// println!("Sport: {}", sport_names.get(&sport_id).unwrap());
// } else
if global_message_num == fit_file::GLOBAL_MSG_NUM_RECORD {
let mut msg = FitRecordMsg::new(fields);

data.num_records_processed += 1;

if let Some(ts) = msg.timestamp {
assert_eq!(timestamp, ts);
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
//!
// TODO: proper docs

pub use fit::Fit;

/// universal Result, but not sendable
pub type Res<T> = Result<T, Box<dyn std::error::Error>>;

#[cfg(feature = "elevation")]
pub mod elevation;
pub use fit::Fit;
pub mod fit;
mod utils;

0 comments on commit 3783607

Please sign in to comment.