You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I updated a project of mine to use ironworks' main branch and need to use Excel sheets.
Using let sheet = excel.sheet(for_type::<ironworks_sheets::sheet::LogMessage>())?; gives compile-time errors because of SheetType not implementing the Display trait.
This is the error message I get:
error[E0277]: `ironworks_sheets::metadata::SheetType<LogMessage>` doesn't implement `std::fmt::Display`
--> src/main.rs:32:29
|
32 | let sheet = excel.sheet(for_type::<ironworks_sheets::sheet::LogMessage>())?;
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ironworks_sheets::metadata::SheetType<LogMessage>` cannot be formatted with the default formatter
| |
| required by a bound introduced by this call
|
= help: the trait `std::fmt::Display` is not implemented for `ironworks_sheets::metadata::SheetType<LogMessage>`, which is required by `ironworks_sheets::metadata::SheetType<LogMessage>:SheetMetadata`
= note:in format strings you may be able to use `{:?}` (or {:#?}for pretty-print) instead
= note: required for `ironworks_sheets::metadata::SheetType<LogMessage>` to implement `ToString`
= note: required for `ironworks_sheets::metadata::SheetType<LogMessage>` to implement `SheetMetadata`
note: required by a bound in `Excel::<'i>::sheet`
--> /Users/evermore/Workspace/Code/scratch/ironworks/ironworks/src/excel/excel.rs:89:18
|
89 | pub fn sheet<S:SheetMetadata>(&self, sheet_metadata:S) -> Result<Sheet<'i,S>> {
| ^^^^^^^^^^^^^ required by this bound in `Excel::<'i>::sheet`
For more information about this error, try `rustc --explain E0277`.
Is this a known problem?
The text was updated successfully, but these errors were encountered:
I can reproduce this, but absolutely no idea what's going on. Even checking out the repositories as of the original implementation of this (that was extensively tested), it's throwing the same issue.
I expect that it's boiling down to impl<S: MetadataAdapter> SheetMetadata for SheetType<S> not taking effect for some reason, but I've not been able to pin that down.
I don't really have the time / headspace to work out what's going on here, especially given that the generated sheets are incredibly outdated and soon to be replaced with exdschema.
For now, I expect you don't need every generated sheet under the sun (nor every field in every sheet) - I'd recommend implementing SheetMetadata directly for the part(s) of the struct you do need.
Hello,
I updated a project of mine to use ironworks'
main
branch and need to use Excel sheets.Using
let sheet = excel.sheet(for_type::<ironworks_sheets::sheet::LogMessage>())?;
gives compile-time errors because of SheetType not implementing theDisplay
trait.This is the error message I get:
Is this a known problem?
The text was updated successfully, but these errors were encountered: