Newbie #Rust question time:
I wan to use the current_local_offset function from the time
library, but I apparently need to import it into my project with the local-offset
feature.
I assume I need to specify this in Cargo.toml
but for the life of me, I can't figure out how. Can someone point me in the right direction?
reshared this
Mo :ferris: :tux:
in reply to Jonathan Lamothe • • •You need to specify the `features` list next to the version in Cargo.toml:
doc.rust-lang.org/cargo/refereβ¦
Alternatively, you can run
`cargo add -F FEATURE1,FEATURE2,β¦`
You can run `cargo add` even after you added a dependency.
Features - The Cargo Book
doc.rust-lang.orgglyn
in reply to Jonathan Lamothe • • •Have you tried something like the following?
time = { version = "0.3.36", features = ["local-offset"] }
Jonathan Lamothe likes this.