Rust no longer requires extern crate calls as of the 2018 update.

Update all the examples to work with the spellbook Array class as well.
This commit is contained in:
2019-01-20 20:38:42 -05:00
parent 3e4094a50c
commit eec868b406
7 changed files with 41 additions and 66 deletions

View File

@ -1,9 +1,7 @@
extern crate weave;
extern crate alchemy;
use weave::Error;
use spellbook::components::Array;
use alchemy::{Converter, Endianess, PlatformEndian, Transmutable};
@ -11,11 +9,11 @@ use alchemy::{Converter, Endianess, PlatformEndian, Transmutable};
fn use_converter()
{
let num: f32;
let mut buffer: Vec<u8>;
let mut buffer: Array<u8>;
// Initialize the variables.
num = 6.291985f32;
buffer = Vec::new();
buffer = Array::new();
println!("Converting the value {} into and out of an array of bytes.", num);
println!("Buffer starts as: {}", stringify_array(buffer.as_slice()));
@ -44,11 +42,11 @@ pub fn use_transmutable()
{
let num: f32;
let endianess: Endianess;
let mut buffer: Vec<u8>;
let mut buffer: Array<u8>;
// Initialize the variables.
num = 6.291985f32;
buffer = Vec::new();
buffer = Array::new();
endianess = Endianess::Platform;
println!("Converting the value {} into and out of an array of bytes.", num);