Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] master from TheAlgorithms:master #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 1 commit into AlgorithmAndLeetCode:master from TheAlgorithms:master
Sep 26, 2025

Conversation

@pull
Copy link

@pull pull bot commented Sep 26, 2025
edited
Loading

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* fix(huffman): Handle edge cases and improve error handling
- Change HuffmanDictionary::new() to return Option<Self> for safer API
- Add proper handling for empty alphabet (returns None)
- Add special case handling for single-symbol alphabets
- Replace unwrap() calls with ? operator in decode() for better error handling
- Add #[inline(always)] optimization for frequently called get_bit()
- Add comprehensive tests for edge cases
- Improve documentation with usage examples
BREAKING CHANGE: HuffmanDictionary::new() now returns Option<Self>
* Test: Increase coverage for huffman_encoding.rs decode method
Adds two new test cases to ensure 100% patch coverage for HuffmanEncoding::decode:
1. test_decode_empty_encoding_struct: Covers the edge case where num_bits == 0.
2. minimal_decode_end_check: Ensures the final 'if self.num_bits > 0' check in the multi-symbol decode path is fully covered.
Corrects 'char-lit-as-u8' and 'unnecessary-cast' lints in the newly added coverage tests to satisfy GitHub Actions.
@pull pull bot locked and limited conversation to collaborators Sep 26, 2025
@pull pull bot added the ⤵️ pull label Sep 26, 2025
@pull pull bot merged commit aa3194f into AlgorithmAndLeetCode:master Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /