Semantic version test fix.

This commit is contained in:
Gav Wood 2016-01-05 19:05:51 +01:00
parent 33a3a96b44
commit 0125125c27
3 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,10 @@ pub type Bytes = Vec<u8>;
/// Slice of bytes to underlying memory
pub trait BytesConvertable {
// TODO: rename to as_slice
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] {

View File

@ -13,6 +13,7 @@ pub enum EthcoreError {
FromHex(FromHexError),
BaseData(BaseDataError),
BadSize,
UnknownName,
}
impl From<FromHexError> for EthcoreError {

View File

@ -2,8 +2,8 @@
///
/// # Example
/// ```
/// extern crate ethcore;
/// use ethcore::engine::*;
/// extern crate ethcore_util;
/// use ethcore_util::semantic_version::*;
/// fn main() {
/// assert_eq!(SemanticVersion::new(1, 2, 3).as_u32(), 0x010203);
/// }