Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions main.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@


use std::io;
use std::io::Read;
use std::fs::File;


fn main() {
let value = 64;
let read_value = &64;

fn read_value(value:i32) -> Result<i32, io::Error>{
let value:i32 = match value.trim().parse() {
Ok(value > 1 || value < 100) => Appropriate
Err(value < 1 || value > 100) => panic!("Guess value must be between 1 and 100")
};

}

}

fn read_username_from () -> Result<String, io::Error> {
let f = File::open("hello.txt");

let mut f = match f {
Ok(file) => file,
Err(e) => return Err(e),

};
let mut s = String::new();
match f.read_to_string(&mut s) {
Ok(_) => Ok(s),
Err(e)=> Err(e),
}


}