Formatted cargo.toml file alphabetically and with consistent format.
Replaced sensible occurrences of panic!() with assert!() for better readability.
-In src/reader/xlsx.rs the return is already XlsxError therefore it doesn't make sense to unwrap() there. Therefore, the error due to read is passed to caller function.
in src/structs/drawing/charts/plot_area.rs some modification to minimize redundant lines.
in src/structs/numbering_format.rs it made sense to use inbuilt method expect() rather than elaborate checking done.
in src/structs/range.rs as the panic!() was already preventing the case where coordinate_collection is other than 1 or 2. It didn't made sense to check again. Hence removed it. Also as it is already known that coordinate_collection is always has length of atleast one. Hence removed redundunt checks.
In src/writer/xlsx/shared_strings.rs small changes to logic to prevent redundant allocation.
In src/structs/worksheet.rs small logical changes to done and removed elaborate checks for simpler logic.
In src/structs/spreadsheet.rs the function return type of several functions changed from Result type to Option type as the only logical reason why getting a sheet with a certain criterion may fail is because it is not found. Therefore reducing the allocation of static string in the binary.
The following changes are done:
cargo.toml
file alphabetically and with consistent format.src/reader/xlsx.rs
the return is alreadyXlsxError
therefore it doesn't make sense tounwrap()
there. Therefore, the error due to read is passed to caller function.src/structs/drawing/charts/plot_area.rs
some modification to minimize redundant lines.src/structs/numbering_format.rs
it made sense to use inbuilt methodexpect()
rather than elaborate checking done.src/structs/range.rs
as thepanic!()
was already preventing the case wherecoordinate_collection
is other than 1 or 2. It didn't made sense to check again. Hence removed it. Also as it is already known thatcoordinate_collection
is always has length of atleast one. Hence removed redundunt checks.src/writer/xlsx/shared_strings.rs
small changes to logic to prevent redundant allocation.src/structs/worksheet.rs
small logical changes to done and removed elaborate checks for simpler logic.src/structs/spreadsheet.rs
the function return type of several functions changed fromResult
type toOption
type as the only logical reason why getting a sheet with a certain criterion may fail is because it is not found. Therefore reducing the allocation of static string in the binary.