sebastienrousseau / dtt

A Rust library for parsing, validating, manipulating, and formatting dates and times 🦀
https://dttlib.com/
Apache License 2.0
6 stars 0 forks source link

Examples failing #57

Closed snspinn closed 6 months ago

snspinn commented 6 months ago

Using 'Example 3' from the README give the errors:

error: argument never used
  --> src/main.rs:10:38
   |
10 |     dtt_print!("Formatted time: {}", formatted_time);
   |     ---------------------------------^^^^^^^^^^^^^^-
   |     |                                |
   |     |                                argument never used
   |     formatting specifier missing

error[E0599]: no method named `format` found for struct `DateTime` in the current scope
 --> src/main.rs:9:30
  |
9 |     let formatted_time = now.format("%Y-%m-%d %H:%M:%S");
  |                              ^^^^^^ method not found in `DateTime`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `dtt_testing` (bin "dtt_testing") due to 2 previous errors

Example 4 doesn't work either but I'm not looking for that feature. A quick look through the code doesn't show the format() in the impl block.

Versions

rustc 1.75.0 (82e1608df 2023-12-21)

Cargo.toml

[package]
name = "dtt_testing"
version = "0.1.0"
edition = "2021"

[dependencies]
dtt = "0.0.5"