mirror of
https://github.com/mii443/RustySecrets.git
synced 2025-08-22 16:25:32 +00:00
keep up with Rust
This commit is contained in:
25
Cargo.lock
generated
25
Cargo.lock
generated
@ -1,15 +1,16 @@
|
||||
[root]
|
||||
name = "secretshare"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
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)",
|
||||
"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]]
|
||||
name = "crc24"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -20,13 +21,27 @@ dependencies = [
|
||||
"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]]
|
||||
name = "log"
|
||||
version = "0.2.2"
|
||||
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]]
|
||||
name = "rustc-serialize"
|
||||
version = "0.2.11"
|
||||
version = "0.2.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "secretshare"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
authors = ["Sebastian Gesemann <s.gesemann@gmail.com>"]
|
||||
description = "This is an implementation of Shamir's secret sharing scheme."
|
||||
license = "GPLv3"
|
||||
@ -10,3 +10,4 @@ readme = "README.md"
|
||||
getopts = "^0.2.1"
|
||||
rustc-serialize = "^0.2.11"
|
||||
crc24 = "^0.1.0"
|
||||
rand = "^0.1.2"
|
||||
|
13
src/main.rs
13
src/main.rs
@ -2,18 +2,19 @@
|
||||
#![feature(core)]
|
||||
#![feature(io)]
|
||||
#![feature(os)]
|
||||
#![feature(rand)]
|
||||
#![feature(env)]
|
||||
#![feature(hash)]
|
||||
|
||||
extern crate core; // FIXME: temporary fix for ParseIntError not being available in std
|
||||
extern crate "rustc-serialize" as serialize;
|
||||
extern crate getopts;
|
||||
extern crate crc24;
|
||||
extern crate rand;
|
||||
|
||||
use std::iter::repeat;
|
||||
use std::old_io::{ stdio, IoError, IoErrorKind, IoResult, BufferedReader };
|
||||
use std::os;
|
||||
use std::rand::{ Rng, OsRng };
|
||||
use std::env;
|
||||
use rand::{ Rng, OsRng };
|
||||
|
||||
use getopts::Options;
|
||||
use serialize::base64::{ self, FromBase64, ToBase64 };
|
||||
@ -264,7 +265,7 @@ fn perform_decode() -> IoResult<()> {
|
||||
|
||||
fn main() {
|
||||
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();
|
||||
opts.optflag("h", "help", "print this help text");
|
||||
@ -276,7 +277,7 @@ fn main() {
|
||||
Ok(m) => m,
|
||||
Err(f) => {
|
||||
drop(writeln!(&mut stderr, "Error: {}", f));
|
||||
os::set_exit_status(1);
|
||||
env::set_exit_status(1);
|
||||
return;
|
||||
}
|
||||
};
|
||||
@ -321,6 +322,6 @@ fn main() {
|
||||
|
||||
if let Err(e) = result {
|
||||
drop(writeln!(&mut stderr, "{}", e));
|
||||
os::set_exit_status(1);
|
||||
env::set_exit_status(1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user