Skip to content

Instantly share code, notes, and snippets.

@hjiayz
hjiayz / playground.rs
Created July 19, 2017 09:17 — forked from anonymous/playground.rs
Rust code shared from the playground
extern crate num;
use num::BigInt;
use num::bigint::ToBigInt;
pub struct GString(pub String);
pub struct Gstr<'a>(pub &'a str);
impl ToBigInt for GString {
fn to_bigint(&self) -> Option<BigInt> {
Some(BigInt::from_signed_bytes_le(self.0.as_bytes()))
}
}