Skip to content

Commit

Permalink
Make Bytes::from_static a const fn
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtj committed Nov 9, 2019
1 parent 856ed7c commit ab533c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bytes.rs
Expand Up @@ -114,7 +114,7 @@ impl Bytes {
/// assert_eq!(&b[..], b"hello");
/// ```
#[inline]
pub fn from_static(bytes: &'static [u8]) -> Bytes {
pub const fn from_static(bytes: &'static [u8]) -> Bytes {
Bytes {
ptr: bytes.as_ptr(),
len: bytes.len(),
Expand Down Expand Up @@ -732,7 +732,7 @@ impl fmt::Debug for Vtable {

// ===== impl StaticVtable =====

static STATIC_VTABLE: Vtable = Vtable {
const STATIC_VTABLE: Vtable = Vtable {
clone: static_clone,
drop: static_drop,
};
Expand Down

0 comments on commit ab533c6

Please sign in to comment.