Skip to content

Refactor: fix cargo lint failures #1403

@sainad2222

Description

@sainad2222

Fix issues from https://github.com/parseablehq/parseable/actions/runs/16809419242/job/47617200705?pr=1402

  1. collapsible_if
    Example:
error: this `if` statement can be collapsed
     --> src/storage/object_storage.rs:890:17
      |
  890 | /                 if let Ok(stats_stream) = PARSEABLE.get_stream(DATASET_STATS_STREAM_NAME) {
  891 | |                     if let Err(err) = stats_stream.flush_and_convert(false, false) {
  892 | |                         error!("Failed in local sync for dataset stats stream: {err}");
  893 | |                     }
  894 | |                 }
      | |_________________^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
  help: collapse nested if block
      |
  890 ~                 if let Ok(stats_stream) = PARSEABLE.get_stream(DATASET_STATS_STREAM_NAME)
  891 ~                     && let Err(err) = stats_stream.flush_and_convert(false, false) {
  892 |                         error!("Failed in local sync for dataset stats stream: {err}");
  893 ~                     }
  1. mismatched_lifetime_syntaxes
    Example:
error: hiding a lifetime that's elided elsewhere is confusing
     --> src/handlers/livetail.rs:276:27
      |
  276 | fn extract_cookie(header: &MetadataMap) -> Option<Cookie> {
      |                           ^^^^^^^^^^^^            ------ the same lifetime is hidden here
      |                           |
      |                           the lifetime is elided here
      |
      = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
      = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
      = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
  help: use `'_` for type paths
      |
  276 | fn extract_cookie(header: &MetadataMap) -> Option<Cookie<'_>> {
      |                                                         ++++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions