Implement Clone to support old compilers
Arrays above size 32 are not Clone on old compilers.
This commit is contained in:
parent
de113feb96
commit
34bea2ee3f
|
@ -49,7 +49,7 @@ pub fn fmt<W: fmt::Write, V: Integer>(mut wr: W, value: V) -> fmt::Result {
|
|||
/// let printed = buffer.format(1234);
|
||||
/// assert_eq!(printed, "1234");
|
||||
/// ```
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Copy)]
|
||||
pub struct Buffer {
|
||||
bytes: [u8; I128_MAX_LEN],
|
||||
}
|
||||
|
@ -61,6 +61,13 @@ impl Default for Buffer {
|
|||
}
|
||||
}
|
||||
|
||||
impl Clone for Buffer {
|
||||
#[inline]
|
||||
fn clone(&self) -> Self {
|
||||
Buffer::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Buffer {
|
||||
/// This is a cheap operation; you don't need to worry about reusing buffers
|
||||
/// for efficiency.
|
||||
|
|
Loading…
Reference in New Issue