Code Files Added
rodzic
cebe4dc0e6
commit
1e5bd65fe0
|
@ -0,0 +1,22 @@
|
|||
// Task : To explain assignment operations in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main(){
|
||||
// Arithmetic Operations
|
||||
println!("5 + 4 = {}", 5+4 );
|
||||
println!("5 - 4 = {}", 5-4 );
|
||||
println!("5 * 4 = {}", 5*4 );
|
||||
println!("5 / 4 = {}", 5/4 );
|
||||
println!("5 % 4 = {}", 5%4 );
|
||||
|
||||
println!("********************");
|
||||
// Assigning data types and mathematical Operations
|
||||
let neg_4 = -4i32;
|
||||
println!("abs(-4) = {}", neg_4.abs() );
|
||||
println!("abs(-4) = {}", neg_4.pow(2) );
|
||||
println!("round(1.2345) = {}", 1.2354f64.round() );
|
||||
println!("ceil(1.2345) = {}", 1.2345f64.ceil() );
|
||||
print!("sin 3.14 = {}", 3.14f64.sin() );
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// Task : To explain array in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
|
||||
// Defining an array
|
||||
let rand_array = [1,2,3];
|
||||
|
||||
println!("random array {:?}",rand_array );
|
||||
// indexing starts with 0
|
||||
println!("random array 1st element {}",rand_array[0] );
|
||||
println!("random array length {}",rand_array.len() );
|
||||
// last two elements
|
||||
println!("random array {:?}",&rand_array[1..3] );
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,21 @@
|
|||
// Task : To explain assignment operations in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
// Primitive libraries in rust
|
||||
use std::{i8,i16,i32,i64,u8,u16,u32,u64,f32,f64,isize,usize};
|
||||
use std::io::stdin;
|
||||
|
||||
fn main() {
|
||||
println!("Understanding assignment");
|
||||
// Complier will automatically figure out the datatype if not mentioned
|
||||
// Cannot change the value
|
||||
let num =10;
|
||||
println!("Num is {}", num);
|
||||
|
||||
// immutuable can change the value
|
||||
let age: i32 =40;
|
||||
println!("Age is {}", age);
|
||||
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,14 @@
|
|||
// Task : To explain boolean operations in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main(){
|
||||
//Setting boolean and character types
|
||||
let bool_val: bool = true;
|
||||
let x_char: char = 'a';
|
||||
|
||||
// Printing the character
|
||||
println!("x char is {}", x_char);
|
||||
println!("Bool value is {}", bool_val);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
// Task : Basic mathematical model on 2 numbers
|
||||
// Date : 26th Dec 2016
|
||||
// Version : 1.0
|
||||
// Author : Vigneshwer
|
||||
|
||||
// Libraries in rust
|
||||
use std::io;
|
||||
use std::{i32};
|
||||
|
||||
// Main Functions
|
||||
fn main() {
|
||||
|
||||
// Entering number 1
|
||||
println!("Enter First number ? ");
|
||||
let mut input_1 = String::new();
|
||||
io::stdin().read_line(&mut input_1)
|
||||
.expect("Failed to read line");
|
||||
|
||||
// Entering number 2
|
||||
println!("Enter second number ? ");
|
||||
let mut input_2 = String::new();
|
||||
io::stdin().read_line(&mut input_2)
|
||||
.expect("Failed to read line");
|
||||
|
||||
// Convert to int
|
||||
let a_int: i32 = input_1.trim().parse()
|
||||
.ok()
|
||||
.expect("Please type a number!");
|
||||
|
||||
let b_int: i32 = input_2.trim().parse()
|
||||
.ok()
|
||||
.expect("Please type a number!");
|
||||
|
||||
// output of basic operations
|
||||
println!("sum is: {}", a_int + b_int);
|
||||
println!("difference is: {}", a_int - b_int);
|
||||
println!("mutlipy is: {}", a_int * b_int);
|
||||
println!("division is: {}", a_int / b_int);
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// Task : To explain assignment operations in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main(){
|
||||
// Prints the first 2 numbers after the decimal points
|
||||
println!("{:.2}",1.2345 );
|
||||
|
||||
println!("================");
|
||||
// print the binary hex and octal format
|
||||
println!("B: {:b} H: {:x} O: {:o}",10,10,10 );
|
||||
|
||||
println!("================");
|
||||
// Shifts
|
||||
println!("{ten:>ws$}",ten=10, ws=5 );
|
||||
println!("{ten:>0ws$}",ten=10, ws=5 );
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,12 @@
|
|||
// Task : To explain assignment operations in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main(){
|
||||
let mut sample_var = 10;
|
||||
println!("Value of the sample variable is {}",sample_var);
|
||||
|
||||
let sample_var = 20;
|
||||
println!("New Value of the sample variable is {}",sample_var);
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,8 @@
|
|||
// Task : Sample program in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
println!("Welcome to Rust Cookbook");
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,64 @@
|
|||
// Task : To explain string in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
// declaring a random string
|
||||
let rand_string = "I love Rust cookbook <3";
|
||||
|
||||
// printing the length of the string
|
||||
println!("length of the string is {}",rand_string.len() );
|
||||
|
||||
// Splits in string
|
||||
let (first,second) = rand_string.split_at(7);
|
||||
println!("First part : {0} Second part : {1}", first,second );
|
||||
|
||||
// Count using iterator count
|
||||
let count = rand_string.chars().count();
|
||||
print!("count {}",count );
|
||||
|
||||
println!("__________________________");
|
||||
// printing all chars
|
||||
let mut chars = rand_string.chars();
|
||||
let mut indiv_chars = chars.next();
|
||||
|
||||
loop {
|
||||
// Its like switch in c++
|
||||
match indiv_chars {
|
||||
Some(x) => println!("{}",x ),
|
||||
None => break
|
||||
}
|
||||
indiv_chars = chars.next();
|
||||
}
|
||||
|
||||
println!("__________________________");
|
||||
// iterate over whitespaces
|
||||
let mut iter = rand_string.split_whitespace();
|
||||
let mut indiv_word = iter.next();
|
||||
|
||||
loop {
|
||||
// Its like switch in c++
|
||||
match indiv_word {
|
||||
Some(x) => println!("{}",x ),
|
||||
None => break
|
||||
}
|
||||
indiv_word = iter.next();
|
||||
}
|
||||
|
||||
println!("__________________________");
|
||||
// iterate over next line
|
||||
let rand_string2 = "I love \n everything about \n Rust <3";
|
||||
let mut iter_line = rand_string2.lines();
|
||||
let mut indiv_sent = iter_line.next();
|
||||
|
||||
loop {
|
||||
// Its like switch in c++
|
||||
match indiv_sent {
|
||||
Some(x) => println!("{}",x ),
|
||||
None => break
|
||||
}
|
||||
indiv_sent = iter_line.next();
|
||||
}
|
||||
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,18 @@
|
|||
// Task : To explain tuples in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{i8};
|
||||
|
||||
fn main() {
|
||||
|
||||
// Declaring a tuple
|
||||
let rand_tuple = ("Mozilla Science Lab", 2016);
|
||||
let rand_tuple2 : (&str, i8) = ("Viki",4);
|
||||
|
||||
// tuple operations
|
||||
println!(" Name : {}", rand_tuple2.0);
|
||||
println!(" Lucky no : {}", rand_tuple2.1);
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Task : To explain vector in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
// declaring a vector
|
||||
let mut vec1 = vec![1,2,3,4,5];
|
||||
|
||||
// printing element 3 in vector
|
||||
println!("Item 3 : {}", vec1[2]);
|
||||
|
||||
// iterating in a vector
|
||||
for i in &vec1 {
|
||||
println!("{}",i );
|
||||
}
|
||||
|
||||
// push an element to vector
|
||||
vec1.push(6);
|
||||
println!("vector after push {:?}", vec1 );
|
||||
// pop an element from vector
|
||||
vec1.pop();
|
||||
println!("vector after pop {:?}", vec1 );
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,24 @@
|
|||
// Task : To explain variable binding in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 19 Feb 2017
|
||||
|
||||
fn main() {
|
||||
// Simplest variable binding
|
||||
let a = 5;
|
||||
// pattern
|
||||
let (b, c) = (1, 2);
|
||||
// type annotation
|
||||
let x_val: i32 = 5;
|
||||
// shadow example
|
||||
let y_val: i32 = 8;
|
||||
{
|
||||
println!("Value assigned when entering the scope : {}", y_val); // Prints "8".
|
||||
let y_val = 12;
|
||||
println!("Value modified within scope :{}", y_val); // Prints "12".
|
||||
}
|
||||
println!("Value which was assigned first : {}", y_val); // Prints "8".
|
||||
let y_val = 42;
|
||||
println!("New value assigned : {}", y_val); // Prints "42".
|
||||
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,18 @@
|
|||
// Task : To explain closures in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{i32};
|
||||
|
||||
fn main() {
|
||||
|
||||
// define a closure
|
||||
let sum_num = |x:i32 , y:i32| x+y;
|
||||
println!("7 + 8 ={}", sum_num(7,8));
|
||||
|
||||
// example 2
|
||||
let num_ten = 10;
|
||||
let add_ten = |x:i32| x+num_ten;
|
||||
println!("3 + 10 ={}", add_ten(3));
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,22 @@
|
|||
// Task : To explain condition in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{i32};
|
||||
|
||||
fn main() {
|
||||
let age : i32= 10;
|
||||
|
||||
// If else statements
|
||||
if age <= 18{
|
||||
println!("Go to School");
|
||||
} else if (age >18) && (age <= 28){
|
||||
println!("Go to college");
|
||||
} else {
|
||||
println!("Do something with your life");
|
||||
}
|
||||
|
||||
let can_vote = if (age >= 18) {true} else {false};
|
||||
println!("Can vote {}",can_vote );
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,25 @@
|
|||
// Task : To explain constants in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 19 Feb 2017
|
||||
|
||||
// Global variables are declared outside scopes of other function
|
||||
const UPPERLIMIT: i32 = 12;
|
||||
|
||||
// function to check if bunber
|
||||
fn is_big(n: i32) -> bool {
|
||||
// Access constant in some function
|
||||
n > UPPERLIMIT
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let random_number = 15;
|
||||
|
||||
// Access constant in the main thread
|
||||
println!("The threshold is {}", UPPERLIMIT);
|
||||
println!("{} is {}", random_number, if is_big(random_number) { "big" } else { "small" });
|
||||
|
||||
// Error! Cannot modify a `const`.
|
||||
// UPPERLIMIT = 5;
|
||||
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,32 @@
|
|||
// Task : To explain enum in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
|
||||
let hulk = Hero::Strong(100);
|
||||
let fasty = Hero::Fast;
|
||||
//converting from
|
||||
let spiderman = Hero::Info {name:"spiderman".to_owned(),secret:"peter parker".to_owned()};
|
||||
|
||||
get_info(spiderman);
|
||||
get_info(hulk);
|
||||
get_info(fasty);
|
||||
}
|
||||
|
||||
// declaring the enum
|
||||
enum Hero {
|
||||
Fast,
|
||||
Strong(i32),
|
||||
Info {name : String, secret : String}
|
||||
}
|
||||
|
||||
// function to perform for each types
|
||||
fn get_info(h:Hero){
|
||||
match h {
|
||||
Hero::Fast => println!("Fast"),
|
||||
Hero::Strong(i) => println!("Lifts {} tons",i ),
|
||||
Hero::Info {name,secret} => { println!(" name is : {0} secret is : {1}", name,secret);} ,
|
||||
}
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,31 @@
|
|||
// Task : To explain constants in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 19 Feb 2017
|
||||
|
||||
// main point of execution
|
||||
fn main() {
|
||||
|
||||
// expression
|
||||
let x_val = 5u32;
|
||||
|
||||
// y block
|
||||
let y_val = {
|
||||
let x_squared = x_val * x_val;
|
||||
let x_cube = x_squared * x_val;
|
||||
|
||||
// This expression will be assigned to `y_val`
|
||||
x_cube + x_squared + x_val
|
||||
};
|
||||
|
||||
// z block
|
||||
let z_val = {
|
||||
// The semicolon suppresses this expression and `()` is assigned to `z`
|
||||
2 * x_val;
|
||||
};
|
||||
|
||||
// printing the final outcomes
|
||||
println!("x is {:?}", x_val);
|
||||
println!("y is {:?}", y_val);
|
||||
println!("z is {:?}", z_val);
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,31 @@
|
|||
// Task : To explain struct in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{f64};
|
||||
|
||||
fn main() {
|
||||
// create a struct variable
|
||||
let mut circle1 = Circle {
|
||||
x:10.0,radius : 10.0
|
||||
};
|
||||
|
||||
println!("x:{},radius : {}", circle1.x, circle1.radius );
|
||||
|
||||
println!("x : {}", circle1.get_x());
|
||||
}
|
||||
|
||||
// define your custom user datatype
|
||||
struct Circle {
|
||||
x : f64,
|
||||
radius : f64,
|
||||
}
|
||||
|
||||
// recommended way of creating structs
|
||||
impl Circle {
|
||||
// pub makes this function public which makes it accessible outsite the scope {}
|
||||
pub fn get_x(&self) -> f64 {
|
||||
self.x
|
||||
}
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,43 @@
|
|||
// Task : To explain looping in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
fn main() {
|
||||
|
||||
// mutuable variable whose value can be changed
|
||||
let mut x =1;
|
||||
println!(" Loop even numbers ");
|
||||
// Continously loops
|
||||
loop {
|
||||
// Check if x is an even number or not
|
||||
if (x % 2 == 0){
|
||||
println!("{}",x);
|
||||
x += 1;
|
||||
// goes to the loop again
|
||||
continue;
|
||||
}
|
||||
// exit if the number is greater than 10
|
||||
if (x > 10) {
|
||||
break;
|
||||
}
|
||||
// increment the number when not even
|
||||
x+=1;
|
||||
}
|
||||
|
||||
let mut y = 1;
|
||||
// while loop
|
||||
println!("while 1 to 9 ");
|
||||
while y < 10 {
|
||||
println!("{}",y );
|
||||
y +=1;
|
||||
}
|
||||
|
||||
let mut z = 1;
|
||||
//for loop
|
||||
println!(" For 1 to 9");
|
||||
for z in 1 .. 10 {
|
||||
println!("{}",z );
|
||||
}
|
||||
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,31 @@
|
|||
// Task : To explain pointers in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{i32};
|
||||
|
||||
fn main() {
|
||||
|
||||
let vect1 = vec![1,2,3];
|
||||
|
||||
// Error in case you are doing this in case of non primitive value
|
||||
// let vec2 = vec1
|
||||
// println!("vec1[0] : {:?}", vec1[0]);
|
||||
|
||||
let prim_val = 1;
|
||||
let prim_val2 = prim_val;
|
||||
println!("primitive value :- {}", prim_val);
|
||||
|
||||
// passing the ownership to the function
|
||||
println!("Sum of vects : {}", sum_vects(&vect1));
|
||||
// Able to pass the non primitive data type
|
||||
println!("vector 1 {:?}", vect1);
|
||||
}
|
||||
|
||||
// Added a reference in the argument
|
||||
fn sum_vects (v1: &Vec<i32>) -> i32 {
|
||||
// apply a closure and iterator
|
||||
let sum = v1.iter().fold(0, |mut sum, &x | {sum += x; sum});
|
||||
return sum;
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,29 @@
|
|||
// Task : To explain struct in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{f64};
|
||||
|
||||
fn main() {
|
||||
// create a struct variable
|
||||
let mut circle1 = Circle {
|
||||
x:10.0,radius : 10.0
|
||||
};
|
||||
|
||||
println!("x:{},radius : {}", circle1.x, circle1.radius );
|
||||
|
||||
println!("Radius : {}", get_radius(&circle1) );
|
||||
|
||||
}
|
||||
|
||||
// define your custom user datatype
|
||||
struct Circle {
|
||||
x : f64,
|
||||
radius : f64,
|
||||
}
|
||||
|
||||
// function which return radius
|
||||
fn get_radius(c1 : &Circle) -> f64{
|
||||
c1.radius
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,51 @@
|
|||
// Task : To explain trait in rust
|
||||
// Author : Vigneshwer
|
||||
// Version : 1.0
|
||||
// Date : 3 Dec 2016
|
||||
|
||||
use std::{f64};
|
||||
|
||||
fn main() {
|
||||
|
||||
// variable of circle datatype
|
||||
let mut circle1 = Circle {
|
||||
r : 10.0
|
||||
};
|
||||
println!("Area of circle {}", circle1.area() );
|
||||
|
||||
// variable of rectangle datatype
|
||||
let mut rect = Rectangle {
|
||||
h:10.0,b : 10.0
|
||||
};
|
||||
println!("Area of rectangle {}", rect.area() );
|
||||
}
|
||||
|
||||
// userdefined datatype rectangle
|
||||
struct Rectangle {
|
||||
h: f64,
|
||||
b: f64,
|
||||
}
|
||||
|
||||
// userdefined datatype circle
|
||||
struct Circle {
|
||||
r: f64,
|
||||
}
|
||||
|
||||
// create a functionality for the datatypes
|
||||
trait HasArea {
|
||||
fn area(&self) -> f64;
|
||||
}
|
||||
|
||||
// implement area for circle
|
||||
impl HasArea for Circle {
|
||||
fn area(&self) -> f64 {
|
||||
3.14 * (self.r *self.r)
|
||||
}
|
||||
}
|
||||
|
||||
// implement area for rectangle
|
||||
impl HasArea for Rectangle {
|
||||
fn area(&self) -> f64 {
|
||||
self.h *self.b
|
||||
}
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,34 @@
|
|||
// Task: Performing type casting in rust
|
||||
// Date: 11 Feb 2016
|
||||
// Version: 0.0.1
|
||||
// Author: Vigneshwer
|
||||
|
||||
use std::{i32,f32};
|
||||
|
||||
// Sample function for assigning values to confusion matrix
|
||||
fn main() {
|
||||
|
||||
// assigning random values to the confusion matrix
|
||||
let(true_positive,true_negative,false_positive,false_negative)=(100,50,10,5);
|
||||
|
||||
// define a total closure
|
||||
let total = true_positive + true_negative + false_positive + false_negative;
|
||||
|
||||
println!("The total predictions {}",total);
|
||||
|
||||
// Calculating the accuracy of the model
|
||||
println!("Accuracy of the model {:.2}",percentage(accuracy(true_positive,true_negative,total)));
|
||||
|
||||
}
|
||||
|
||||
// Accuracy Measures the overall performance of the model
|
||||
fn accuracy(tp:i32,tn:i32,total:i32) -> f32 {
|
||||
// if semi-colon is not put then that returns
|
||||
// No automatic type cast in rust
|
||||
(tp as f32 + tn as f32 )/(total as f32)
|
||||
}
|
||||
|
||||
// Converting to percentage
|
||||
fn percentage(value:f32) -> f32 {
|
||||
value as f32 *100.0
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
[root]
|
||||
name = "hello_world"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"rand 0.3.14 (git+https://github.com/rust-lang-nursery/rand.git?rev=9f35b8e)",
|
||||
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kernel32-sys"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.3.14"
|
||||
source = "git+https://github.com/rust-lang-nursery/rand.git?rev=9f35b8e#9f35b8e439eeedd60b9414c58f389bdc6a3284f9"
|
||||
dependencies = [
|
||||
"libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.1.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "0.1.80"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "thread-id"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utf8-ranges"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-build"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[metadata]
|
||||
"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
|
||||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||
"checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5"
|
||||
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
|
||||
"checksum rand 0.3.14 (git+https://github.com/rust-lang-nursery/rand.git?rev=9f35b8e)" = "<none>"
|
||||
"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753"
|
||||
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
|
||||
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
||||
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
||||
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
||||
"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
|
||||
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
|
||||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "hello_world"
|
||||
version = "0.1.0"
|
||||
authors = ["Vigneshwer.D <dvigneshwer@gmail.com>"]
|
||||
|
||||
[dependencies]
|
||||
time = "0.1.12"
|
||||
regex = "0.1.41"
|
||||
rand = { git = "https://github.com/rust-lang-nursery/rand.git", rev = "9f35b8e" }
|
|
@ -0,0 +1 @@
|
|||
target
|
|
@ -0,0 +1,8 @@
|
|||
extern crate regex;
|
||||
|
||||
use regex::Regex;
|
||||
|
||||
fn main() {
|
||||
let re = Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
|
||||
println!("Did our date match? {}", re.is_match("2014-01-01"));
|
||||
}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
dfc8789243e23ada
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":2822179955554191932,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.5.3"]},"features":"None","deps":[["memchr v0.1.11",9796655647945095179]],"rustflags":[]}
|
|
@ -0,0 +1 @@
|
|||
7cded6463fd5eade
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":2983294961366240915,"profile":11154289914177168617,"local":{"variant":"MtimeBased","fields":[[1486962385,354966260],[47,104,111,109,101,47,118,105,107,105,47,114,117,115,116,95,99,111,111,107,98,111,111,107,47,99,104,97,112,116,101,114,51,47,104,101,108,108,111,95,119,111,114,108,100,47,116,97,114,103,101,116,47,100,101,98,117,103,47,46,102,105,110,103,101,114,112,114,105,110,116,47,104,101,108,108,111,95,119,111,114,108,100,45,54,51,102,101,98,98,54,102,55,101,48,101,52,102,52,52,47,100,101,112,45,98,105,110,45,104,101,108,108,111,95,119,111,114,108,100]]},"features":"None","deps":[["rand v0.3.14 (https://github.com/rust-lang-nursery/rand.git?rev=9f35b8e#9f35b8e4)",13226203809758372760],["regex v0.1.80",1978488238110420625],["time v0.1.36",1283136440624876714]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
1cf3f950c7134396
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":2983294961366240915,"profile":14216767367406228602,"local":{"variant":"MtimeBased","fields":[[1486962612,514974731],[47,104,111,109,101,47,118,105,107,105,47,114,117,115,116,95,99,111,111,107,98,111,111,107,47,99,104,97,112,116,101,114,51,47,104,101,108,108,111,95,119,111,114,108,100,47,116,97,114,103,101,116,47,100,101,98,117,103,47,46,102,105,110,103,101,114,112,114,105,110,116,47,104,101,108,108,111,95,119,111,114,108,100,45,54,51,102,101,98,98,54,102,55,101,48,101,52,102,52,52,47,100,101,112,45,116,101,115,116,45,98,105,110,45,104,101,108,108,111,95,119,111,114,108,100]]},"features":"None","deps":[["rand v0.3.14 (https://github.com/rust-lang-nursery/rand.git?rev=9f35b8e#9f35b8e4)",13226203809758372760],["regex v0.1.80",1978488238110420625],["time v0.1.36",1283136440624876714]],"rustflags":[]}
|
|
@ -0,0 +1 @@
|
|||
d1a1cce467c66d55
|
|
@ -0,0 +1 @@
|
|||
1fafa3e3cb7e026f
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":4086851835445132369,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.2.2"]},"features":"None","deps":[["winapi-build v0.1.1",17837523682249557571]],"rustflags":[]}
|
|
@ -0,0 +1 @@
|
|||
{"rustc":0,"target":0,"profile":0,"local":{"variant":"Precalculated","fields":["0.2.2"]},"features":"","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
a4afa36e230ccdcf
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":6026625737212813429,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.2.2"]},"features":"None","deps":[["winapi v0.2.8",8159171814049759188]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
00b3ce50ff4e2fa3
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":12975131716389151093,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.2.20"]},"features":"Some([\"default\", \"use_std\"])","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
0b78972a68b6f487
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":15077895593472080321,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.1.11"]},"features":"None","deps":[["libc v0.2.20",11758704010567004928]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
98e3901f4aea8cb7
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":9445322636251195083,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["9f35b8e439eeedd60b9414c58f389bdc6a3284f9"]},"features":"None","deps":[["libc v0.2.20",11758704010567004928]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
912edcf09100751b
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":12670156471944522085,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.1.80"]},"features":"None","deps":[["aho-corasick v0.5.3",15725129828765583583],["memchr v0.1.11",9796655647945095179],["regex-syntax v0.3.9",2097099445182631133],["thread_local v0.2.7",18134237447290576221],["utf8-ranges v0.1.3",13231105802975277104]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
dd8cc7a0d5641a1d
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":16088928192531196849,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.3.9"]},"features":"None","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
9e46f94439dcd8c5
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":12631885209046341097,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["2.0.0"]},"features":"None","deps":[["kernel32-sys v0.2.2",14973637682396376996],["libc v0.2.20",11758704010567004928]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
5d5d5706e1c0a9fb
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":12399525229491177571,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.2.7"]},"features":"None","deps":[["thread-id v2.0.0",14256386758969738910]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
aa0cce5dcb9dce11
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":593786052017149270,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.1.36"]},"features":"None","deps":[["libc v0.2.20",11758704010567004928]],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
3070f35ba0549eb7
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":17624444246549344061,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.1.3"]},"features":"None","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
d4bfd02589333b71
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":7062486825205066367,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.2.8"]},"features":"None","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
43461a21489d8bf7
|
|
@ -0,0 +1 @@
|
|||
{"rustc":16218068117412374134,"target":3649318858816229980,"profile":11154289914177168617,"local":{"variant":"Precalculated","fields":["0.1.1"]},"features":"None","deps":[],"rustflags":[]}
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue