Skip to content

Compile error on HEAD: Option<NaiveDate>::to_string() in src/output/data.rs:84 #65

@Delibread0601

Description

@Delibread0601

Building latest main (4b5a749) fails with cargo install --path .:

error[E0599]: `std::option::Option<NaiveDate>` doesn't implement `std::fmt::Display`
  --> src/output/data.rs:84:48
   |
84 |                         "end_date": p.end_date.to_string(),
   |                                                ^^^^^^^^^ method cannot be called on `std::option::Option<NaiveDate>` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `std::option::Option<NaiveDate>: std::fmt::Display`
           which is required by `std::option::Option<NaiveDate>: ToString`

p.end_date is Option<NaiveDate>, so .to_string() must be mapped over the Option — e.g. .map(|d| d.to_string()).unwrap_or_default(), or emit null via serde_json::Value::Null when absent.

Introduced in #60 (commit adding the closed-positions JSON output block). Last compilable commit: e1c021f.

Environment

  • macOS 15.x
  • rustc 1.90.0 (1159e78c4 2025-09-14) stable
  • cargo install --path .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions