Skip to content

Commit

Permalink
Merge pull request #1878 from psyklopp/master
Browse files Browse the repository at this point in the history
Update primitives.md with examples
  • Loading branch information
marioidival authored Aug 26, 2024
2 parents 8f94061 + 7bf3ae8 commit 859786c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Rust By Example

[![Build Status][travis-badge]][travis-repo]

[travis-badge]: https://travis-ci.com/rust-lang/rust-by-example.svg?branch=master
[travis-repo]: https://travis-ci.com/rust-lang/rust-by-example
[![Build Status](https:/rust-lang/rust-by-example/actions/workflows/rbe.yml/badge.svg)](https:/rust-lang/rust-by-example/actions)

Learn Rust with examples (Live code editor included)

Expand Down
9 changes: 9 additions & 0 deletions src/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ fn main() {
// Variables can be overwritten with shadowing.
let mutable = true;
/* Compound types - Array and Tuple */
// Array signature consists of Type T and length as [T; length].
let my_array: [i32; 5] = [1, 2, 3, 4, 5];
// Tuple is a collection of values of different types
// and is constructed using parentheses ().
let my_tuple = (5u32, 1u8, true, -5.04f32);
}
```

Expand Down

0 comments on commit 859786c

Please sign in to comment.