Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-saad-la committed Jul 18, 2024
1 parent 0d313b7 commit fbdb14a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/04_compound_data/arrays/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ fn implicit_array_type_inference() {
// Access Array Elements
fn access_array_elements() {
// Define an array
let rand_arr: [f64; 10] = gen_rand_floats(10, 0)
let arr: [f64; 10] = gen_rand_floats(10, 0)
.try_into()
.expect("Slice with incorrect length");
let arr = &rand_arr[..];

// Accessing elements by index
let first = arr[0];
let second = arr[1];
Expand All @@ -93,7 +93,7 @@ fn access_array_elements() {
println!("Element at index {}: {}", index, element);
}

let [first, second, .., last] = rand_arr;
let [first, second, .., last] = arr;
println!("First: {}, Second: {}, Last: {}", first, second, last);

// Safe access with get method
Expand Down
1 change: 1 addition & 0 deletions src/chap_01/install_rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Verify the Installation: To ensure Rust is installed correctly, run the followin
```sh
rustc --version
```
### Checking the Installation
After successfully completing the Rust installation, you will have four new commands available in your command line tool. These commands are essential for managing your Rust environment, compiling code, generating documentation, and handling packages. It is important to verify that each of these commands is properly installed and configured.
Expand Down
1 change: 1 addition & 0 deletions src/rust-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Rust history

0 comments on commit fbdb14a

Please sign in to comment.