Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sinex: deprecated calls #60

Open
larsnaesbye opened this issue Nov 30, 2022 · 3 comments
Open

sinex: deprecated calls #60

larsnaesbye opened this issue Nov 30, 2022 · 3 comments
Assignees
Labels
enhancement New feature provided

Comments

@larsnaesbye
Copy link
Collaborator

With chrono 0.4.23 some functions are deprecated: chronotope/chrono#827

   Compiling sinex v0.1.0 (/Users/lanch/Desktop/Dev/rinex/sinex)
warning: use of deprecated associated function `chrono::NaiveDate::and_hms`: use `and_hms_opt()` instead
  --> sinex/src/datetime.rs:20:11
   |
20 |     Ok(dt.and_hms(h as u32, m as u32, s as u32))
   |           ^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default
@larsnaesbye larsnaesbye self-assigned this Nov 30, 2022
@gwbres gwbres added the enhancement New feature provided label Dec 1, 2022
@gwbres
Copy link
Collaborator

gwbres commented Dec 5, 2022

We should replace chrono by hifiime just like we did in the main crate

This crate only uses chrono::NaiveDatetime, it gets replaced by hifitime::Epoch

Parsing from a string:

Self {
   [...]
   date: parse_datetime(content.trim())?
}

fn parse_datetime(content: &str) -> Result<chrono::NaiveDatetime [...]

becomes something like this

fn parse_datetime(content: &str) -> Result<Epoch, [...]
     let duration = Duration::from_hours(h)
            + Duration::from_minutes(m)
            + Duration::from_seconds(s)
            + [...] ; 
     Epoch::from_duration(duration, TimeScale::UTC)

@larsnaesbye
Copy link
Collaborator Author

Ah yes, replacing with HiFiTime will fix it anyway.

@gwbres
Copy link
Collaborator

gwbres commented Dec 5, 2022

Ah yes, replacing with HiFiTime will fix it anyway.

but that still remains to be done 😄 because this is a seperate crate

@gwbres gwbres reopened this Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature provided
Projects
None yet
Development

No branches or pull requests

2 participants