Skip to content
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

Fix formatting and clippy errors #3

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

jcrossley3
Copy link
Contributor

@jcrossley3 jcrossley3 commented Mar 5, 2024

More work toward #1

@jcrossley3 jcrossley3 force-pushed the formatting branch 2 times, most recently from c6b54d3 to 4e86fb8 Compare March 5, 2024 20:17
Signed-off-by: Jim Crossley <jim@crossleys.org>
Add nettle dep, caching and rename job

Signed-off-by: Jim Crossley <jim@crossleys.org>
Also reorganized a few tests beneath a single `tests` module

Signed-off-by: Jim Crossley <jim@crossleys.org>
@jcrossley3 jcrossley3 changed the title appease rustfmt Fix formatting and clippy errors Mar 5, 2024
Comment on lines -930 to -931
#[cfg(test)]
mod tests {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bobmcwhirter This looks like more changes than it is. I just moved all the tests beneath a single tests module.

Comment on lines +138 to +142
// impl From<&&str> for Purl {
// fn from(value: &&str) -> Self {
// PackageUrl::from_str(value).unwrap().into()
// }
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bobmcwhirter I thought this looked weird. It's not used, but I forgot to delete it.

@@ -128,15 +128,18 @@ impl Debug for Purl {

impl From<&str> for Purl {
fn from(value: &str) -> Self {
PackageUrl::from_str(value).unwrap().into()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bobmcwhirter We're using a clippy rule that doesn't like unwrap. We only allow them for tests. I don't know if deriving Default is The Right Thing in this case or not, but seemed harmless.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the answer is TryFrom instead since failure is an option.

@jcrossley3 jcrossley3 merged commit 7a51629 into trustification:main Mar 5, 2024
1 check passed
@jcrossley3 jcrossley3 deleted the formatting branch March 5, 2024 21:10
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.

2 participants