keep up with Rust

This commit is contained in:
Sebastian Gesemann
2015-02-05 15:26:12 +01:00
parent 4a5682fb64
commit 6edf29480b
3 changed files with 29 additions and 12 deletions

25
Cargo.lock generated
View File

@ -1,15 +1,16 @@
[root] [root]
name = "secretshare" name = "secretshare"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"crc24 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "crc24 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "crc24" name = "crc24"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -20,13 +21,27 @@ dependencies = [
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "libc"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "log" name = "log"
version = "0.2.2" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "rustc-serialize" name = "rustc-serialize"
version = "0.2.11" version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "secretshare" name = "secretshare"
version = "0.1.1" version = "0.1.2"
authors = ["Sebastian Gesemann <s.gesemann@gmail.com>"] authors = ["Sebastian Gesemann <s.gesemann@gmail.com>"]
description = "This is an implementation of Shamir's secret sharing scheme." description = "This is an implementation of Shamir's secret sharing scheme."
license = "GPLv3" license = "GPLv3"
@ -10,3 +10,4 @@ readme = "README.md"
getopts = "^0.2.1" getopts = "^0.2.1"
rustc-serialize = "^0.2.11" rustc-serialize = "^0.2.11"
crc24 = "^0.1.0" crc24 = "^0.1.0"
rand = "^0.1.2"

View File

@ -2,18 +2,19 @@
#![feature(core)] #![feature(core)]
#![feature(io)] #![feature(io)]
#![feature(os)] #![feature(os)]
#![feature(rand)] #![feature(env)]
#![feature(hash)] #![feature(hash)]
extern crate core; // FIXME: temporary fix for ParseIntError not being available in std extern crate core; // FIXME: temporary fix for ParseIntError not being available in std
extern crate "rustc-serialize" as serialize; extern crate "rustc-serialize" as serialize;
extern crate getopts; extern crate getopts;
extern crate crc24; extern crate crc24;
extern crate rand;
use std::iter::repeat; use std::iter::repeat;
use std::old_io::{ stdio, IoError, IoErrorKind, IoResult, BufferedReader }; use std::old_io::{ stdio, IoError, IoErrorKind, IoResult, BufferedReader };
use std::os; use std::env;
use std::rand::{ Rng, OsRng }; use rand::{ Rng, OsRng };
use getopts::Options; use getopts::Options;
use serialize::base64::{ self, FromBase64, ToBase64 }; use serialize::base64::{ self, FromBase64, ToBase64 };
@ -264,7 +265,7 @@ fn perform_decode() -> IoResult<()> {
fn main() { fn main() {
let mut stderr = stdio::stderr(); let mut stderr = stdio::stderr();
let args = os::args(); let args: Vec<String> = env::args().map(|oss| oss.into_string().unwrap()).collect();
let mut opts = Options::new(); let mut opts = Options::new();
opts.optflag("h", "help", "print this help text"); opts.optflag("h", "help", "print this help text");
@ -276,7 +277,7 @@ fn main() {
Ok(m) => m, Ok(m) => m,
Err(f) => { Err(f) => {
drop(writeln!(&mut stderr, "Error: {}", f)); drop(writeln!(&mut stderr, "Error: {}", f));
os::set_exit_status(1); env::set_exit_status(1);
return; return;
} }
}; };
@ -321,6 +322,6 @@ fn main() {
if let Err(e) = result { if let Err(e) = result {
drop(writeln!(&mut stderr, "{}", e)); drop(writeln!(&mut stderr, "{}", e));
os::set_exit_status(1); env::set_exit_status(1);
} }
} }