Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #71 from s-brian/Issue-69
Browse files Browse the repository at this point in the history
Fixes #69
  • Loading branch information
dirvine committed Jun 18, 2015
2 parents 8535d3a + 065fc28 commit 80cb341
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# maidsafe_types

[![](https://img.shields.io/badge/Project%20SAFE-Approved-green.svg)](http://maidsafe.net/applications) [![](https://img.shields.io/badge/License-GPL3-green.svg)](https://github.com/maidsafe/maidsafe_types/blob/master/COPYING)

**Primary Maintainer:** Brian Smith (brian.smith@maidsafe.net)

|Crate|Linux|Windows|OSX|Coverage|
|:------:|:-------:|:-------:|:-------:|:-------:|
|[![](http://meritbadge.herokuapp.com/maidsafe_types)](https://crates.io/crates/maidsafe_types)|[![Build Status](https://travis-ci.org/maidsafe/maidsafe_types.svg?branch=master)](https://travis-ci.org/maidsafe/maidsafe_types)|[![Build Status](http://ci.maidsafe.net:8080/buildStatus/icon?job=maidsafe_types_win64_status_badge)](http://ci.maidsafe.net:8080/job/maidsafe_types_win64_status_badge/)|[![Build Status](http://ci.maidsafe.net:8080/buildStatus/icon?job=maidsafe_types_osx_status_badge)](http://ci.maidsafe.net:8080/job/maidsafe_types_osx_status_badge/)|[![Coverage Status](https://coveralls.io/repos/maidsafe/maidsafe_types/badge.svg)](https://coveralls.io/r/maidsafe/maidsafe_types)|
|Crate|Linux|Windows|OSX|Coverage|Issues|
|:------:|:-------:|:-------:|:-------:|:-------:|:-------:|
|[![](http://meritbadge.herokuapp.com/maidsafe_types)](https://crates.io/crates/maidsafe_types)|[![Build Status](https://travis-ci.org/maidsafe/maidsafe_types.svg?branch=master)](https://travis-ci.org/maidsafe/maidsafe_types)|[![Build Status](http://ci.maidsafe.net:8080/buildStatus/icon?job=maidsafe_types_win64_status_badge)](http://ci.maidsafe.net:8080/job/maidsafe_types_win64_status_badge/)|[![Build Status](http://ci.maidsafe.net:8080/buildStatus/icon?job=maidsafe_types_osx_status_badge)](http://ci.maidsafe.net:8080/job/maidsafe_types_osx_status_badge/)|[![Coverage Status](https://coveralls.io/repos/maidsafe/maidsafe_types/badge.svg)](https://coveralls.io/r/maidsafe/maidsafe_types)|[![Stories in Ready](https://badge.waffle.io/maidsafe/maidsafe_types.png?label=ready&title=Ready)](https://waffle.io/maidsafe/maidsafe_types)


| [ API Documentation](http://maidsafe.github.io/maidsafe_types/) | [SAFENetwork System Documention](http://systemdocs.maidsafe.net/) | [MaidSafe website](http://www.maidsafe.net) | [Safe Community site](https://forum.safenetwork.io) |

Expand Down
5 changes: 3 additions & 2 deletions src/data/immutable_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,20 @@ impl Decodable for ImmutableDataSacrificial {

#[cfg(test)]
mod test {
extern crate rand;

use super::*;
use self::rand::Rng;
use cbor::{ Encoder, Decoder};
use rustc_serialize::{Decodable, Encodable};
use Random;
use rand;
use routing::sendable::Sendable;
use routing::types::array_as_vector;
use sodiumoxide::crypto;

#[allow(unused_variables)]
impl Random for ImmutableData {
fn generate_random() -> ImmutableData {
use rand::Rng;
let size = 64;
let mut data = Vec::with_capacity(size);
let mut rng = rand::thread_rng();
Expand Down
3 changes: 2 additions & 1 deletion src/data/structured_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ impl Decodable for StructuredData {
}
#[cfg(test)]
mod test {
extern crate rand;

use super::*;
use cbor::{ Encoder, Decoder };
use rustc_serialize::{Decodable, Encodable};
use routing;
use routing::NameType;
use routing::sendable::Sendable;
use Random;
use rand;

impl Random for StructuredData {
fn generate_random() -> StructuredData {
Expand Down
8 changes: 4 additions & 4 deletions src/id/id_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use sodiumoxide::crypto;
use helper::*;
use super::revocation_id_type::*;
use std::cmp;
use std::fmt;
use routing::NameType;

Expand Down Expand Up @@ -92,7 +91,7 @@ impl IdType {
}
}

impl cmp::PartialEq for IdType {
impl PartialEq for IdType {
fn eq(&self, other: &IdType) -> bool {
// Private keys are mathematically linked, so just check public keys
&self.type_tag == &other.type_tag &&
Expand Down Expand Up @@ -153,13 +152,14 @@ impl Decodable for IdType {

#[cfg(test)]
mod test {
extern crate rand;

use super::*;
use self::rand::Rng;
use cbor;
use super::super::RevocationIdType;
use sodiumoxide::crypto;
use Random;
use rand;
use rand::Rng;
use MaidTypeTags;

impl Random for IdType {
Expand Down
5 changes: 3 additions & 2 deletions src/id/revocation_id_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ impl Decodable for RevocationIdType {

#[cfg(test)]
mod test {
extern crate rand;

use self::rand::Rng;
use cbor;
use rand;
use rand::Rng;
use Random;
use sodiumoxide::crypto;
use super::RevocationIdType;
Expand Down
20 changes: 15 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,33 @@

#![crate_name = "maidsafe_types"]
#![crate_type = "lib"]
#![deny(missing_docs)]
#![doc(html_logo_url = "http://maidsafe.net/img/Resources/branding/maidsafe_logo.fab2.png",
html_favicon_url = "http://maidsafe.net/img/favicon.ico",
html_root_url = "http://dirvine.github.io/dirvine/maidsafe_types/")]
html_root_url = "http://maidsafe.github.io/maidsafe/maidsafe_types/")]

#![forbid(bad_style, warnings)]

#![deny(deprecated, improper_ctypes, missing_docs, non_shorthand_field_patterns,
overflowing_literals, plugin_as_library, private_no_mangle_fns, private_no_mangle_statics,
raw_pointer_derive, stable_features, unconditional_recursion, unknown_lints, // unsafe_code,
unsigned_negation, unused, unused_allocation, unused_attributes, unused_comparisons,
unused_features, unused_parens, while_true)]

#![warn(trivial_casts, trivial_numeric_casts, unused_extern_crates, unused_import_braces,
unused_qualifications, variant_size_differences)]

//! #Safe Network Data Types
//!
//! This library implements the fundimental data types used on the SAFE Network
//! The serialisation mechnism used is ``cbor``` which is an IETF Rfc [7049](http://tools.ietf.org/html/rfc7049)
//! for serialising data and is an attempt to upgrade messagepack and ASN.1
//! On disk serialisation is [JSON](https://www.ietf.org/rfc/rfc4627.txt)
//!
//! [Project github page](https://github.com/dirvine/maidsafe_types)
#![deny(missing_docs)]
//! [Project github page](https://github.com/maidsafe/maidsafe_types)

extern crate rustc_serialize;
extern crate sodiumoxide;
extern crate cbor;
extern crate rand;
extern crate routing;

/// Helper provides helper functions for array to vector conversions and vice versa
Expand Down

0 comments on commit 80cb341

Please sign in to comment.