Semantic version test fix.
This commit is contained in:
parent
33a3a96b44
commit
0125125c27
@ -92,7 +92,10 @@ pub type Bytes = Vec<u8>;
|
|||||||
|
|
||||||
/// Slice of bytes to underlying memory
|
/// Slice of bytes to underlying memory
|
||||||
pub trait BytesConvertable {
|
pub trait BytesConvertable {
|
||||||
|
// TODO: rename to as_slice
|
||||||
fn bytes(&self) -> &[u8];
|
fn bytes(&self) -> &[u8];
|
||||||
|
fn as_slice(&self) -> &[u8] { self.bytes() }
|
||||||
|
fn to_bytes(&self) -> Bytes { self.as_slice().to_vec() }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> BytesConvertable for &'a [u8] {
|
impl<'a> BytesConvertable for &'a [u8] {
|
||||||
|
@ -13,6 +13,7 @@ pub enum EthcoreError {
|
|||||||
FromHex(FromHexError),
|
FromHex(FromHexError),
|
||||||
BaseData(BaseDataError),
|
BaseData(BaseDataError),
|
||||||
BadSize,
|
BadSize,
|
||||||
|
UnknownName,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<FromHexError> for EthcoreError {
|
impl From<FromHexError> for EthcoreError {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate ethcore;
|
/// extern crate ethcore_util;
|
||||||
/// use ethcore::engine::*;
|
/// use ethcore_util::semantic_version::*;
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// assert_eq!(SemanticVersion::new(1, 2, 3).as_u32(), 0x010203);
|
/// assert_eq!(SemanticVersion::new(1, 2, 3).as_u32(), 0x010203);
|
||||||
/// }
|
/// }
|
||||||
|
Loading…
Reference in New Issue
Block a user