mirror of
https://github.com/mii443/RustySecrets.git
synced 2025-08-23 00:35:38 +00:00
keep up with Rust
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -2,20 +2,20 @@
|
|||||||
name = "secretshare"
|
name = "secretshare"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crc24 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crc24 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"getopts 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"getopts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.1.2 (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)",
|
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc24"
|
name = "crc24"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getopts"
|
name = "getopts"
|
||||||
version = "0.2.3"
|
version = "0.2.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "secretshare"
|
name = "secretshare"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
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
src/main.rs
10
src/main.rs
@ -1,11 +1,9 @@
|
|||||||
#![feature(collections)]
|
#![feature(collections)]
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
#![feature(io)]
|
#![feature(io)]
|
||||||
#![feature(os)]
|
|
||||||
#![feature(env)]
|
#![feature(env)]
|
||||||
#![feature(hash)]
|
#![feature(hash)]
|
||||||
|
|
||||||
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;
|
||||||
@ -14,8 +12,9 @@ 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::env;
|
use std::env;
|
||||||
use rand::{ Rng, OsRng };
|
use std::num;
|
||||||
|
|
||||||
|
use rand::{ Rng, OsRng };
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use serialize::base64::{ self, FromBase64, ToBase64 };
|
use serialize::base64::{ self, FromBase64, ToBase64 };
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ macro_rules! otry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// maps a ParseIntError to an IoError
|
/// maps a ParseIntError to an IoError
|
||||||
fn pie2io(p: core::num::ParseIntError) -> IoError {
|
fn pie2io(p: num::ParseIntError) -> IoError {
|
||||||
IoError {
|
IoError {
|
||||||
detail: Some(p.to_string()),
|
detail: Some(p.to_string()),
|
||||||
.. other_io_err("Int parsing error")
|
.. other_io_err("Int parsing error")
|
||||||
@ -265,7 +264,7 @@ fn perform_decode() -> IoResult<()> {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut stderr = stdio::stderr();
|
let mut stderr = stdio::stderr();
|
||||||
let args: Vec<String> = env::args().map(|oss| oss.into_string().unwrap()).collect();
|
let args: Vec<String> = env::args().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");
|
||||||
@ -325,3 +324,4 @@ fn main() {
|
|||||||
env::set_exit_status(1);
|
env::set_exit_status(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user