From afc67dac024d633262c9bae46c90e6199b915e4a Mon Sep 17 00:00:00 2001 From: psyklopp Date: Sun, 25 Aug 2024 15:45:08 +0200 Subject: [PATCH 1/3] update primitives.md with example of array and tuple --- src/primitives.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/primitives.md b/src/primitives.md index 6560e99e96..65c38bf625 100644 --- a/src/primitives.md +++ b/src/primitives.md @@ -49,6 +49,15 @@ fn main() { // Variables can be overwritten with shadowing. let mutable = true; + + /* Compound types - Array and Tuples */ + + // 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); } ``` From f8482292c043367ac17f12c32d9ea929f11cb39d Mon Sep 17 00:00:00 2001 From: psyklopp Date: Sun, 25 Aug 2024 15:46:33 +0200 Subject: [PATCH 2/3] update primitives.md with example of array and tuple --- src/primitives.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/primitives.md b/src/primitives.md index 65c38bf625..cdbee02e77 100644 --- a/src/primitives.md +++ b/src/primitives.md @@ -50,7 +50,7 @@ fn main() { // Variables can be overwritten with shadowing. let mutable = true; - /* Compound types - Array and Tuples */ + /* 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]; From 7bf3ae8f949fbbbe9fc3bf0973f3b3bca32a5878 Mon Sep 17 00:00:00 2001 From: psyklopp Date: Sun, 25 Aug 2024 19:10:32 +0200 Subject: [PATCH 3/3] Fix README.md - add workflow status badge --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 7d4728374a..68a8714a3b 100644 --- a/README.md +++ b/README.md @@ -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://github.com/rust-lang/rust-by-example/actions/workflows/rbe.yml/badge.svg)](https://github.com/rust-lang/rust-by-example/actions) Learn Rust with examples (Live code editor included)