Skip to content

Remove dependencies for cross-compillation and use thiserror::Error derive for the ConfigValidationError - #37

Merged
FineFindus merged 2 commits into
libre-tube:mainfrom
sourcenix:main
Oct 27, 2026
Merged

FineFindus merged 2 commits into
libre-tube:mainfrom
sourcenix:main

Conversation

@sourcenix

Copy link
Copy Markdown
Contributor

No description provided.

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.
Comment thread src/config.rs
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),
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any advantage to using thiserror here. It saves very little code, but increases the compile time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compile time increase is minimal and using thiserror here makes the code more consistent with the other error handling.

@FineFindus FineFindus Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more than happy to also remove the dependency elsewhere :)

@sourcenix sourcenix changed the title Remove dependencies for cross-compillation and use thiserror::Error derive for the ConfigCalidationError Remove dependencies for cross-compillation and use thiserror::Error derive for the ConfigValidationError Oct 27, 2026
@FineFindus
FineFindus merged commit 1177ed0 into libre-tube:main Oct 27, 2026
5 checks passed
@FineFindus

Copy link
Copy Markdown
Contributor

Thanks!

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.

4 participants