Skip to content

Version3.0#300

Merged
MathNya merged 168 commits intomasterfrom
version3.0
Nov 27, 2025
Merged

Version3.0#300
MathNya merged 168 commits intomasterfrom
version3.0

Conversation

@MathNya
Copy link
Copy Markdown
Owner

@MathNya MathNya commented Nov 27, 2025

No description provided.

mxsrm and others added 30 commits December 17, 2024 20:13
* refactor: simplify `split_rgb` string slicing logic

- Updated the `split_rgb` function in `src/helper/color.rs` to replace manual character skipping and collecting with direct string slicing (`&rgb[0..2]`, etc.).
- Improves readability and reduces unnecessary intermediate string allocations.
- Maintains the same functionality for parsing RGB hex strings into `(i32, i32, i32)`.

* refactor: clippy lint in writer/driver.rs

error: written amount is not handled
   --> src/writer/driver.rs:49:5
    |
49  |     writer.get_mut().write(data.into().as_bytes());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `Write::write_all` instead, or handle partial writes
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount

* chore: update lint configuration to enforce stricter Clippy rules

- Removed `#![allow(warnings)]` and `#![allow(clippy::all)]` directives to prevent silencing all lints.
- Added `#![deny(clippy::correctness)]` to ensure critical correctness issues are treated as errors.
- Enabled warnings for additional Clippy categories: `style`, `complexity`, `perf`, and `cargo`.
- Improves code quality by emphasizing best practices, maintainability, and performance.

* refactor: fix `cargo check` warnings

* refactor: clippy lints

* fix(tests): umya-spreadsheet::integration_test issue_172 was failing

* style: cargo fmt

* deps: update `chrono` crate to v0.4.39

* refactor!: trivial copy pass by ref

In many calling conventions instances of structs will be passed
through registers if they fit into two or less general purpose registers.

This patch removes most of the references used for the basic integer,
float and boolean types.

Closes #239.
…ration

- Replaced `getrandom` crate with `rand` to simplify and modernize random number generation.
- Updated `gen_random_*` functions to use `rand::thread_rng().fill()` for generating random bytes of specified lengths.
- Adjusted encryption functions to use `gen_random_bytes` for generating random values.
…to rows, and column_dimensions to columns

- Renamed `cell_collection` to `cells` for consistency and clarity.
- Renamed `row_dimensions` to `rows` for improved readability.
- Renamed `column_dimensions` to `columns` for better understanding.
- Updated all method calls and references accordingly.
This commit removes the `ahash` dependency and replaces its usage with the standard library's `DefaultHasher`. This change simplifies the dependency tree and reduces external dependencies while maintaining the same hashing functionality.

- Removed the `ahash` crate from `Cargo.toml`.
- Updated the `SharedStringItem` struct to use `std::hash::DefaultHasher` instead of `AHasher` from `ahash`.
…tion

This commit refactors the random byte generation in the `gen_random_bytes` function by replacing the use of `OsRng` with `thread_rng`. This change simplifies the code and improves performance by using the thread-local random number generator.

- Updated the `gen_random_bytes` function to utilize `thread_rng()` for filling the byte vector.
- Removed the `OsRng` import as it is no longer needed.
This commit simplifies the test code by replacing custom hex decoding
and encoding functions with the `hex-literal` crate. This change
improves readability and reduces boilerplate code in the tests.

- Removed `decode_hex` and `encode_hex` helper functions.
- Updated test cases to use the `hex!` macro for byte literals.
This commit sorts the dependencies in `Cargo.toml` for improved
readability and organization. Sorting helps maintain a consistent
format and makes it easier to locate specific dependencies.
This commit removes the lint configurations from `Cargo.toml` and
transfers them to `lib.rs` using attribute macros. This change
centralizes lint settings within the codebase, making it easier to
manage and understand the linting rules applied to the project.

- Removed lint settings from `Cargo.toml`.
- Added lint attributes in `lib.rs` for better backwards compatibility.
This commit refactors the code to replace the use of the `is_none_or`
method with match statements. This change improves compatibility with
a lower minimum supported Rust version, since `is_none_or` is only
available in stable since Rust 1.82.0.

- Updated `is_support` method in `TwoCellAnchor` to use match.
- Refactored `_has_vertical` and `has_horizontal` methods in `MergeCells`
  to use match for start and end row/column checks.
This commit sets the minimum supported Rust version in `Cargo.toml`
to 1.79.0, as determined by the `cargo-msrv` tool. This version is
dictated by the `bitstream-io` dependency, which is a transitive
dependency of the `image` crate. Setting the minimum version ensures
compatibility with the required features and functionality.

- Added `rust-version = "1.79.0"` to `Cargo.toml`.
This commit removes the unused `js` feature from the `[features]`
section in `Cargo.toml`. The `js` feature is no longer utilized in
the project, and its removal helps to maintain a cleaner configuration.
Previously, this feature led to the inclusion of the `js` feature from
the `getrandom` dependency, which was removed in a prior commit.

- Deleted the `js` feature entry from `Cargo.toml`.
… calendar systems

* add `num-traits` dependency for numeric casts
* introduce `DEFAULT_TIMEZONE` constant for consistency
* implement `excel_to_date_time_object` for converting Excel timestamps to `NaiveDateTime`
* add `convert_date_windows_1900` and `convert_date_mac_1904` for specific calendar systems
* enhance `convert_date_crate` to support both Windows 1900 and Mac 1904 systems
* include detailed documentation for new functions with examples and panic behavior
…d enhance RNG security

- Introduced the `generate_random_bytes!` macro to eliminate repetitive code for generating random bytes.
- Replaced `rand::thread_rng` with `rand::rngs::OsRng` to utilize a cryptographically secure random number generator.
- Updated cryptographic key constants to use fixed-size arrays instead of slices for improved type safety.
- Enhanced error handling in random byte generation by adding `expect` messages.
- Removed unused imports and commented-out code to clean up the codebase.
- Improved consistency in hash function implementations and key management.

This refactoring improves code maintainability, readability, and security by centralizing random byte generation and ensuring the use of secure RNG sources.
Extract multiple static variables into the `constants` module, eliminating the need to pass them as parameters in function calls. This refactor simplifies function signatures, centralizes configuration values, and enhances maintainability. Future updates may revert this approach to accommodate support for additional algorithms as the crate evolves.
…_code at crate level

- Rename private methods across multiple modules by removing leading underscores to adhere to Rust naming conventions.
- Additionally, add `#![allow(dead_code)]` at the crate level to silence dead code warnings.
…sheet processing

- Reorganized the `make_buffer` function for better readability and maintainability.
- Replaced manual iteration with `try_for_each` for processing worksheets.
- Consolidated worksheet processing logic to handle both deserialized and raw data more cleanly.
- Improved comments for clarity on each processing step.
- Streamlined the addition of various worksheet components (charts, drawings, comments, etc.).
- Ensured proper handling of printer settings and other worksheet relationships.
…tions

* Add detailed parameter descriptions and return values for all public functions
* Improve documentation formatting and clarity for encryption methods
* Add specific documentation for AES-256-CBC implementation details
* Include clippy allow attributes for possible truncation warnings
* Document HMAC and IV generation processes
* Add comprehensive documentation for password-to-key conversion logic
This fixes the following `clippy` warning:
> multiple versions for dependency `thiserror`: 1.0.69, 2.0.8
> for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

`thiserror` and `thiserror-impl` are transitive dependencies:

```sh
cargo tree --invert --package thiserror-impl@1.0.69

thiserror-impl v1.0.69 (proc-macro)
└── thiserror v1.0.69
    ├── html_parser v0.7.0
    │   └── umya-spreadsheet v2.2.0 (/home/mxsrm/code/umya-spreadsheet)
    └── rav1e v0.7.1
        └── ravif v0.11.11
            └── image v0.25.5
                └── umya-spreadsheet v2.2.0 (/home/mxsrm/code/umya-spreadsheet)

cargo tree --invert --package thiserror-impl@2.0.8

thiserror-impl v2.0.8 (proc-macro)
└── thiserror v2.0.8
    ├── pest v2.7.15
    │   ├── html_parser v0.7.0
    │   │   └── umya-spreadsheet v2.2.0 (/home/mxsrm/code/umya-spreadsheet)
    │   ├── pest_derive v2.7.15 (proc-macro)
    │   │   └── html_parser v0.7.0 (*)
    │   ├── pest_generator v2.7.15
    │   │   └── pest_derive v2.7.15 (proc-macro) (*)
    │   └── pest_meta v2.7.15
    │       └── pest_generator v2.7.15 (*)
    └── zip v2.2.2
        └── umya-spreadsheet v2.2.0 (/home/mxsrm/code/umya-spreadsheet)
```
…lization

- Refactored the `is_address` function to use `OnceLock` for lazy initialization of the regex pattern, improving performance by compiling the regex only once.
- Enhanced documentation for `is_address` to clarify its parameters, return values, and potential panics.
- Removed the previous implementation of `is_address` to streamline the code.
- Added examples in the documentation to demonstrate usage.
@MathNya MathNya merged commit 2e8a30f into master Nov 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants