diff --git a/README.md b/README.md index 4a76faf..720695b 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [rust](https://github.com/mcmah309/rust) (formally known as [rust_core](https://pub.dev/packages/rust_core)) is a pure Dart implementation of patterns found in the [Rust programming language](https://www.rust-lang.org/), bringing the power of Rust to Dart! -Types include [Result](https://mcmah309.github.io/rust/libs/result/result.html), [Option](https://mcmah309.github.io/rust/libs/option/option.html), [Cell](https://mcmah309.github.io/rust/libs/cell/cell.html), [Slice](https://mcmah309.github.io/rust/libs/slice/slice.html), [Array](https://mcmah309.github.io/rust/libs/array/array.html), [Iterator](https://mcmah309.github.io/rust/libs/iter/iter.html), [Channels](https://mcmah309.github.io/rust/libs/sync/channels.html), [Mutex](https://mcmah309.github.io/rust/libs/sync/mutex.html), and more. +Types include [Result](https://mcmah309.github.io/rust/libs/result/result.html), [Option](https://mcmah309.github.io/rust/libs/option/option.html), [Cell](https://mcmah309.github.io/rust/libs/cell/cell.html), [Slice](https://mcmah309.github.io/rust/libs/slice/slice.html), [Array](https://mcmah309.github.io/rust/libs/array/array.html), [Iterator](https://mcmah309.github.io/rust/libs/iter/iter.html), [Channels](https://mcmah309.github.io/rust/libs/sync/channels.html), [Mutex](https://mcmah309.github.io/rust/libs/sync/mutex.html), [Path](https://mcmah309.github.io/rust/libs/path/path.html) and more. -See the [Book 📖](https://mcmah309.github.io/rust) +See the [Book 📖](https://mcmah309.github.io/rust) for more! ## Example > Goal: Get the index of every "!" in a string not followed by a "?" diff --git a/book/src/libs/array/array.md b/book/src/libs/array/array.md index a4d9cbe..e149f14 100644 --- a/book/src/libs/array/array.md +++ b/book/src/libs/array/array.md @@ -21,7 +21,7 @@ var array = Arr(null, 10); // Creates an array of 10 null values #### From a Constant List ```dart -var array = Arr.constant(const [1, 2, 3, 4, 5]); // Creates an array from a constant list +const array = Arr.constant(const [1, 2, 3, 4, 5]); // Creates an array from a constant list ``` #### Using a Generator Function @@ -51,7 +51,7 @@ You can use a for-in loop to iterate over the elements: ```dart for (final entry in array) { - print(entry); // Do something with each entry + print(entry); } ``` @@ -60,7 +60,7 @@ for (final entry in array) { You can convert `Arr` back to a regular list (this will be erased at compile time so there is no cost): ```dart -var list = array.list; +var list = array.asList(); ``` ### Splitting Arrays @@ -68,5 +68,5 @@ var list = array.list; You can split an array into two slices: ```dart -var (slice1, slice2) = array.splitSlice(3); // Splits the array at index 3 +var (slice1, slice2) = array.splitSlice(3); ``` \ No newline at end of file