Added cargo file and updated name to fit

This commit is contained in:
2020-06-11 13:52:09 -04:00
parent 93737abed3
commit 3dc9661907
21 changed files with 48 additions and 7 deletions

4
.gitignore vendored
View File

@@ -2,5 +2,5 @@
.vscode/ .vscode/
#Ignore all executables #Ignore all executables
*.exe target/
Cargo.lock

9
Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "Tutorials"
version = "0.1.0"
authors = ["Mattrixwv <m_ellison@ymail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

3
src/CustomTypes.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod Structures;
pub mod Enums;
pub mod Constants;

View File

@@ -7,7 +7,7 @@ fn is_big(n: i32) -> bool{
n > THRESHOLD n > THRESHOLD
} }
fn main(){ pub fn main(){
let n = 16; let n = 16;
//Access constant in the main thread //Access constant in the main thread

View File

@@ -1,3 +1,8 @@
pub mod Use;
pub mod CLike;
pub mod TestCaseLinkedList;
//Create an `enum` to classify a web event. Note how both //Create an `enum` to classify a web event. Note how both
//names and type information together specify the variant: //names and type information together specify the variant:
//`PageLoad != PageUnload` and `KeyPress(char) != Paste(String)`. //`PageLoad != PageUnload` and `KeyPress(char) != Paste(String)`.
@@ -58,5 +63,5 @@ fn main(){
inspect(unload); inspect(unload);
// We can refer to each variant via its alias, not its long and inconvenient name. // We can refer to each variant via its alias, not its long and inconvenient name.
let x = Operations::Add; //let x = Operations::Add;
} }

View File

@@ -1,4 +1,4 @@
use crate::List::*; use List::*;
enum List{ enum List{
//Cons: Tuple struct that wraps an element and a pointer to the next node //Cons: Tuple struct that wraps an element and a pointer to the next node

View File

@@ -13,9 +13,11 @@ enum Work{
fn main(){ fn main(){
// Explicitly `use` each name so they are available without manual scoping. // Explicitly `use` each name so they are available without manual scoping.
use crate::Status::{Poor, Rich}; //use crate::Status::{Poor, Rich};
use Status::{Poor, Rich};
//Automatically `use` each name inside `Work`. //Automatically `use` each name inside `Work`.
use crate::Work::*; //use crate::Work::*;
use Work::*;
//Equivalent to `Status::Poor`. //Equivalent to `Status::Poor`.
let status = Poor; let status = Poor;

2
src/HelloWorld.rs Normal file
View File

@@ -0,0 +1,2 @@
pub mod Comments;
pub mod FormattedPrint;

View File

@@ -5,6 +5,12 @@
//This is a hello world program for rust //This is a hello world program for rust
pub mod Debugging;
pub mod Display;
pub mod TestcaseList;
pub mod Formatting;
fn main(){ fn main(){
// In general, the `{}` will be automatically replaced with any // In general, the `{}` will be automatically replaced with any
// arguments. These will be stringified. // arguments. These will be stringified.

3
src/Primitives.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod LiteralsAndOperators;
pub mod Tuples;
pub mod ArraysAndSlices;

11
src/main.rs Normal file
View File

@@ -0,0 +1,11 @@
#![allow(non_snake_case)]
#![allow(dead_code)]
mod HelloWorld;
mod Primitives;
mod CustomTypes;
fn main(){
println!("Hello World");
}