File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,12 @@ impl ReasonPhrase {
50
50
Self ( Bytes :: from_static ( reason) )
51
51
}
52
52
53
+ // Not public on purpose.
53
54
/// Converts a `Bytes` directly into a `ReasonPhrase` without validating.
54
55
///
55
56
/// Use with care; invalid bytes in a reason phrase can cause serious security problems if
56
57
/// emitted in a response.
57
- pub unsafe fn from_bytes_unchecked ( reason : Bytes ) -> Self {
58
+ pub ( crate ) fn from_bytes_unchecked ( reason : Bytes ) -> Self {
58
59
Self ( reason)
59
60
}
60
61
}
Original file line number Diff line number Diff line change @@ -1059,7 +1059,7 @@ impl Http1Transaction for Client {
1059
1059
if let Some ( reason) = reason {
1060
1060
// Safety: httparse ensures that only valid reason phrase bytes are present in this
1061
1061
// field.
1062
- let reason = unsafe { crate :: ext:: ReasonPhrase :: from_bytes_unchecked ( reason) } ;
1062
+ let reason = crate :: ext:: ReasonPhrase :: from_bytes_unchecked ( reason) ;
1063
1063
extensions. insert ( reason) ;
1064
1064
}
1065
1065
You can’t perform that action at this time.
0 commit comments