Skip to content

Commit

Permalink
doc: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Dec 2, 2024
1 parent f9d8d1b commit 8a2c860
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 "?"
Expand Down
8 changes: 4 additions & 4 deletions book/src/libs/array/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
```

Expand All @@ -60,13 +60,13 @@ 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

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);
```

0 comments on commit 8a2c860

Please sign in to comment.