MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files
MIT License
240 stars 41 forks source link

`Worksheet::get_collection_by_row` API removed #57

Closed KyGost closed 2 years ago

KyGost commented 2 years ago

See comment on commit, here: https://github.com/MathNya/umya-spreadsheet/commit/5e59501e8f2da176e58860df75e5a9bef603f6f6#r70855324

KyGost commented 2 years ago

Is there an efficient way to reimplement Worksheet::get_collection_by_row? It is a nice, useful API. Often we think of things with columns as types of information and rows as instances of that information. As such it is nice to go over rows and reference columns; A nice API would be something like: -> HashMap<u32, HashMap<u32, Cell>> Or, for efficient iteration: -> Vec<Vec\<Cell>> (row and column numbers can be obtained via Iterator::enumerate)

MathNya commented 2 years ago

I didn't like the fact that the return value was a BTreeMap, so I removed it once. I will reimplement it. HashMap<u32, HashMap<u32, Cell>> seems to be a good return value.

MathNya commented 2 years ago

Several related functions are provided. (The return value is different from the expected value.)

https://github.com/MathNya/umya-spreadsheet/blob/89c50a8521c5cf8034cf12dbf521c577bdea64c2/src/structs/worksheet.rs#L251-L265