informationsea / xlsxwriter-rs

Excel file writer for Rust
https://crates.io/crates/xlsxwriter
Apache License 2.0
265 stars 44 forks source link

Make DataValidationType a data-bound enum #44

Closed 2ndDerivative closed 1 year ago

2ndDerivative commented 1 year ago

It would probably be very "rusty" to change the data validation type from a blank enum with possibly unused fields to an enum with fields like so

pub enum DataValidationType {
    None,
    Integer(i64),
    List(Vec<String>)
}

and so on. If that's too much work I will look into it, but it would probably be good to leverage the type system to ensure data field completeness at the point where Rust usually expects it.

2ndDerivative commented 1 year ago

I was looking into it and was wondering what the difference between "None" and "Any" in the data validation enum is @informationsea

Edit: I am sorry for spamming closed/reponen, didn't notice the button had went "close with comment"

2ndDerivative commented 1 year ago

45 I have made a proposal to solve this issue

informationsea commented 1 year ago

Thank you for pull request. I merged.