Removed the Cargo.lock file from the repo and made Sigils a feature.

The Sigils library will now only be compiled in and able to convert
math structures if the convert_sigils feature is selected.

use_std would have also been set as a feature, but the library heavily
uses std::collections::vec::Vec. Until a non-std version of a collection
has been written, then this needs to be used.
This commit is contained in:
Myrddin Dundragon 2016-08-24 13:23:56 -04:00
parent 1ac74b27d4
commit 4f62caf654
5 changed files with 20 additions and 60 deletions

2
.gitignore vendored
View File

@ -14,4 +14,4 @@
# Remove Cargo.lock from gitignore if creating an executable,
# leave it for libraries.
# More information here: http://doc.crates.io/guide.html#cargotoml-vs-cargolock
#Cargo.lock
Cargo.lock

53
Cargo.lock generated
View File

@ -1,53 +0,0 @@
[root]
name = "alchemy"
version = "0.1.0"
dependencies = [
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
"scribe 0.1.0 (git+https://gitlab.com/CyberMages/scribe.git)",
"sigils 0.1.0 (git+https://gitlab.com/CyberMages/sigils.git)",
]
[[package]]
name = "advapi32-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "scribe"
version = "0.1.0"
source = "git+https://gitlab.com/CyberMages/scribe.git#e52418d3bfc28cd1f03cc7f31af06fce2e03f844"
[[package]]
name = "sigils"
version = "0.1.0"
source = "git+https://gitlab.com/CyberMages/sigils.git#e64c3b0fbecca351e0a078fefc4273a0f0b8e6ad"
[[package]]
name = "winapi"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

View File

@ -9,11 +9,14 @@ documentation = ""
keywords = ["converter", "binary"]
[dependencies.scribe]
git = "https://gitlab.com/CyberMages/scribe.git"
[features]
default = []
convert_sigils = ["sigils"]
[dependencies.sigils]
git = "https://gitlab.com/CyberMages/sigils.git"
[dependencies]
scribe = { git = "https://gitlab.com/CyberMages/scribe.git" }
sigils = { optional = true, git = "https://gitlab.com/CyberMages/sigils.git" }
[dev-dependencies]
rand = "*"
rand = { version = "*" }

View File

@ -1,15 +1,18 @@
//! The Alchemy library is a data type to byte converter library.
//! Alchemy handles converting numbers to and from bytes
//! in either big or little endian format.
#![doc(html_logo_url="http://cybermagesllc.com/wp-content/uploads/2012/06/logo-300x300.png",
#![doc(html_logo_url="",
html_favicon_url="http://cybermagesllc.com/favicon.ico",
html_root_url="http://cybermagesllc.com")]
#![feature(associated_consts)]
#![warn(missing_docs)]
#[macro_use]
extern crate scribe;
#[cfg(feature="sigils")]
extern crate sigils;

View File

@ -1,5 +1,8 @@
#[cfg(feature="convert_sigils")]
use sigils::{Zero, Number, Real};
#[cfg(feature="convert_sigils")]
use sigils::vector::{Vector, Vector2, Vector3, Vector4};
#[cfg(feature="convert_sigils")]
use sigils::quaternion::Quaternion;
use ::byte_sized::{ByteSized, get_byte_size_of_string};
@ -552,6 +555,7 @@ impl Transmutable for String
}
}
#[cfg(feature="convert_sigils")]
impl<T> Transmutable for Vector2<T> where T: Number + ByteSized + Transmutable
{
fn from_bytes(buffer: &[u8], endianess: Endianess) -> Vector2<T>
@ -605,6 +609,7 @@ impl<T> Transmutable for Vector2<T> where T: Number + ByteSized + Transmutable
}
}
#[cfg(feature="convert_sigils")]
impl<T> Transmutable for Vector3<T> where T: Number + ByteSized + Transmutable
{
fn from_bytes(buffer: &[u8], endianess: Endianess) -> Vector3<T>
@ -660,6 +665,7 @@ impl<T> Transmutable for Vector3<T> where T: Number + ByteSized + Transmutable
}
}
#[cfg(feature="convert_sigils")]
impl<T> Transmutable for Vector4<T> where T: Number + ByteSized + Transmutable
{
fn from_bytes(buffer: &[u8], endianess: Endianess) -> Vector4<T>
@ -717,6 +723,7 @@ impl<T> Transmutable for Vector4<T> where T: Number + ByteSized + Transmutable
}
}
#[cfg(feature="convert_sigils")]
impl<T> Transmutable for Quaternion<T>
where T: Real + ByteSized + Transmutable
{