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

chore(dev): more tricky clippy fixes #1237

Merged
merged 9 commits into from
Jan 29, 2025
Merged

chore(dev): more tricky clippy fixes #1237

merged 9 commits into from
Jan 29, 2025

Conversation

pront
Copy link
Member

@pront pront commented Jan 28, 2025

Summary

Part 3. Properly fixing the code around casts would be a breaking change. For now, I just removed the global #[allow(...)] blocks so that we don't introduce new code with these problems.

Previous PR: #1236

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References

@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jan 28, 2025
@@ -84,14 +84,15 @@ fn parse_layer(value: &RawValue, remaining_depth: u8) -> std::result::Result<Jso

fn validate_depth(value: Value) -> ExpressionResult<u8> {
let res = value.try_integer()?;
let res = u8::try_from(res).map_err(|e| e.to_string())?;
Copy link
Member Author

Choose a reason for hiding this comment

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

We already check for [1, 128] below so this is not a breaking change.

@pront pront changed the title chore(dev): deny cast_sign_loss chore(dev): more tricky clippy fixes Jan 28, 2025
@pront pront marked this pull request as ready for review January 28, 2025 22:13
@pront pront requested review from bfung and jszwedko January 28, 2025 22:13
Comment on lines 140 to 141
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
// TODO consider removal options
Copy link
Member

Choose a reason for hiding this comment

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

Nit I'd find this slightly easier to read if the TODO was above the clippy allow.

@pront pront enabled auto-merge January 29, 2025 00:46
@pront pront added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit 198229d Jan 29, 2025
14 checks passed
@pront pront deleted the pront/cast_sign_loss branch January 29, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants