Skip to content

Commit f4d07d4

Browse files
fix: correct misleading expect messages in HeaderValue conversions
The panic messages described the normal case rather than the failure case, making them confusing when read as panic output.
1 parent 5ed4ceb commit f4d07d4

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/headers/content_range.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,8 @@ impl FromStr for ParsedSize {
196196

197197
impl From<&HttpContentRange> for HeaderValue {
198198
fn from(value: &HttpContentRange) -> Self {
199-
HeaderValue::from_maybe_shared(value.to_string()).expect(
200-
"The `HttpContentRange` Display implementation produces nonvisible ASCII characters",
201-
)
199+
HeaderValue::from_maybe_shared(value.to_string())
200+
.expect("`HttpContentRange` Display produced non-visible ASCII characters")
202201
}
203202
}
204203

src/headers/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl FromStr for HttpRange {
6767
impl From<&HttpRange> for HeaderValue {
6868
fn from(value: &HttpRange) -> Self {
6969
HeaderValue::from_maybe_shared(value.to_string())
70-
.expect("The `HttpRange` Display implementation produces nonvisible ASCII characters")
70+
.expect("`HttpRange` Display produced non-visible ASCII characters")
7171
}
7272
}
7373

0 commit comments

Comments
 (0)