1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! # WEBSITE READING
//!
//! This code peice is used to put agruements into your terminal when running cargo, to 1: Search for the file name (txt) , 2: Search for a specific word in the file.txt
//!
//! HOW IT'S USED: Cargo run file_name Word_to_seach_for
//! To turn off search caps sensitive you can run: $env:CAPS_SENS = "true/false"
//!
/// # Examples
///
/// ```rust
///
/// //WITHOUT ANY ARGUEMENTS
/// fn reading_file() {
/// use std::fs::File;
/// let mut message = String::new();
/// let file = File::open("Name.txt");
///
/// match file {
/// Ok(mut file) => {
/// use std::io::Read;
/// let file_text = file.read_to_string(&mut message);
///
/// match file_text {
/// Ok(_) => println!("FILE TEXT: {}", message),
/// Err(error) => println!("HAD THE ERROR WHILE READING {}", error),
/// }
/// },
/// Err(error) => println!("THE ERROR FOUND IS: {:?}", error),
/// }
/// }
/// fn main() {
/// reading_file();
/// }
/// ```