Skip to content

Use a descriptive .expect("...") instead of bare .unwrap() in test: src/config.rs:1905 #562

Description

@Markadrian6399
// src/config.rs:1905
assert_eq!(ListenerMode::parse("STREAM").unwrap(), ListenerMode::Stream);

This is test code, so panicking on failure is expected behavior -- not a
production risk. But a bare .unwrap() gives no context when the test
fails (just "called Result::unwrap() on an Err value" with no
indication of what was being asserted). Replacing it with
.expect("...") and a short message describing the expected condition
makes test failures faster to diagnose from CI logs alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions