[PR #16] [MERGED] refactor: improve error handling and code quality #27

Closed
opened 2026-05-22 22:05:14 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/corn-config/corn/pull/16
Author: @JakeStanger
Created: 5/24/2023
Status: Merged
Merged: 5/24/2023
Merged by: @JakeStanger

Base: masterHead: refactor/general


📝 Commits (1)

  • ab1af29 refactor: improve error handling and code quality

📊 Changes

10 files changed (+221 additions, -204 deletions)

View changed files

📝 Cargo.lock (+39 -27)
assets/inputs/invalid_nesting.corn (+4 -0)
📝 corn-cli/src/bin/corn.rs (+9 -8)
📝 corn-cli/src/error.rs (+22 -35)
📝 libcorn/Cargo.toml (+4 -3)
📝 libcorn/src/de.rs (+55 -25)
📝 libcorn/src/error.rs (+15 -56)
📝 libcorn/src/lib.rs (+1 -1)
📝 libcorn/src/parser.rs (+71 -48)
📝 libcorn/tests/parser_tests.rs (+1 -1)

📄 Description

Replaces any panics with proper error handling.

Removes all unwraps, replacing them with either proper error handling or expect calls where appropriate.

Introduces thiserror to reduce error boilerplate, along with some general improvements to error code.

Fixes several pedantic clippy warnings to improve code quality.

Updates a couple of dependencies.

Resolves #13.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/corn-config/corn/pull/16 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 5/24/2023 **Status:** ✅ Merged **Merged:** 5/24/2023 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `refactor/general` --- ### 📝 Commits (1) - [`ab1af29`](https://github.com/corn-config/corn/commit/ab1af29219dc82ce86e32eb466a9d24ee6f195b6) refactor: improve error handling and code quality ### 📊 Changes **10 files changed** (+221 additions, -204 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+39 -27) ➕ `assets/inputs/invalid_nesting.corn` (+4 -0) 📝 `corn-cli/src/bin/corn.rs` (+9 -8) 📝 `corn-cli/src/error.rs` (+22 -35) 📝 `libcorn/Cargo.toml` (+4 -3) 📝 `libcorn/src/de.rs` (+55 -25) 📝 `libcorn/src/error.rs` (+15 -56) 📝 `libcorn/src/lib.rs` (+1 -1) 📝 `libcorn/src/parser.rs` (+71 -48) 📝 `libcorn/tests/parser_tests.rs` (+1 -1) </details> ### 📄 Description Replaces any panics with proper error handling. Removes all unwraps, replacing them with either proper error handling or `expect` calls where appropriate. Introduces `thiserror` to reduce error boilerplate, along with some general improvements to error code. Fixes several pedantic clippy warnings to improve code quality. Updates a couple of dependencies. Resolves #13. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-22 22:05:14 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
corn-config/corn#27
No description provided.