Repository navigation
Remove dependencies for cross-compillation and use thiserror::Error derive for the ConfigValidationError - #37
Merged
Merged
Conversation
The dependencies for cross-compilation were removed, because in addition to `libsqlite3-sys`, the `openssl-sys` library with the `vendor` feature was needed for cross-compilation, requiring gcc, make, and perl for building. It would be much better to install the necessary libraries to compile the project on the machine itself.
FineFindus
reviewed
Oct 26, 2026
Comment on lines
79
to
-100
| /// Invalid config errors. | ||
| #[derive(thiserror::Error, Debug)] | ||
| pub enum ConfigValidationError { | ||
| /// A default value has been used for a secret. | ||
| #[error("`{0}` is using the default value, please change it")] | ||
| DefaultSecret(&'static str), | ||
| /// The set URL is not valid. | ||
| #[error("`{0}` is not a valid URL")] | ||
| InvalidUrl(&'static str), | ||
| } | ||
|
|
||
| impl Display for ConfigValidationError { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
| match self { | ||
| ConfigValidationError::DefaultSecret(value) => write!( | ||
| f, | ||
| "`{}` is using the default value, please change it", | ||
| value | ||
| ), | ||
| ConfigValidationError::InvalidUrl(value) => write!(f, "`{}` is not a valid URL", value), | ||
| } | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
I don't think there is any advantage to using thiserror here. It saves very little code, but increases the compile time.
Member
There was a problem hiding this comment.
The compile time increase is minimal and using thiserror here makes the code more consistent with the other error handling.
Contributor
There was a problem hiding this comment.
I'm more than happy to also remove the dependency elsewhere :)
Bnyro
approved these changes
Oct 26, 2026
thiserror::Error derive for the ConfigCalidationErrorthiserror::Error derive for the ConfigValidationError
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.