pub fn store(activity: &Activity, config: &Config) -> Result<()> {
    let dir_path = super::init_data_dir(&config);

    let file_path = path_for_date(&activity.timestamp.date(), config);

    let mut file: File = init_activity_file(&file_path)
        .with_context(|| format!("Activity file {:?} could not be initialized", &dir_path))?;

    writeln!(
        &mut file,
        "{};{};{}",
        ts2str(activity.timestamp),
        activity.reps,
        activity.category
    )
    .with_context(|| format!("Could not write activity to file {:?}", &dir_path))?;

    Ok(())
}
/// Store the given activity on the filesystem
Store the given activity on the filesystem
Store the given activity on the filesystem
pub fn store(activity: &Activity, config: &Config) -> Result<()> {
    let dir_path = super::init_data_dir(&config);
    let file_path = path_for_date(&activity.timestamp.date(), config);
    let mut file: File = init_activity_file(&file_path)
        .with_context(|| format!("Activity file {:?} could not be initialized", &dir_path))?;
    writeln!(
        &mut file,
        "{};{};{}",
        ts2str(activity.timestamp),
        activity.reps,
        activity.category
    )
    .with_context(|| format!("Could not write activity to file {:?}", &dir_path))?;
    Ok(())
}
pub fn store ( activity : & Activity , config : & Config ) -> Result < ( ) > { let dir_path = super :: init_data_dir ( & config ) ; let file_path = path_for_date ( & activity . timestamp . date ( ) , config ) ; let mut file : File = init_activity_file ( & file_path ) . with_context ( | | format ! ( " " dir_path ) ) ? ; writeln ! ( mut file " " ts2str ( activity timestamp ) activity reps activity category ) . with_context ( | | format ! ( " " dir_path ) ) ? ; Ok ( ( ) ) }
Store the given activity on the filesystem
Store the given activity on the filesystem
activity
&Activity
config
&Config