feat(status): add StatusCode::try_from(u16).
This is a temporary function until the `TryFrom` trait stabilizes. BREAKING CHANGE: Removes the undocumented `from_u16` function. Use `StatusCode::try_from` instead. Also makes the `status` module private. All imports of `hyper::status::StatusCode` should be `hyper::StatusCode`.
This commit is contained in:
@@ -89,7 +89,7 @@ impl RawStatus {
|
||||
/// Converts this into a StatusCode.
|
||||
#[inline]
|
||||
pub fn status(&self) -> StatusCode {
|
||||
StatusCode::from_u16(self.0)
|
||||
StatusCode::try_from(self.0).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user