Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Feb 29, 2024
1 parent 6c80089 commit 9fbb396
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ const VERSION: i32 = 1;
const HEADER: &[i32] = concat_slices!([i32]: MAGIC, &[0, VERSION]);
```

If the type is not a std integer, `f32`, `f64`, or `char` type then you must
also provide an initializer expression with the type, in the form `[init; T]: `. This also works for custom types as long as the type and initializer
expression is able to be specified in an array initializer expression.

```rust
const PRIMARIES: &'static [(u8, u8, u8)] = &[(255, 0, 0), (0, 255, 0), (0, 0, 255)];
const SECONDARIES: &'static [(u8, u8, u8)] = &[(255, 255, 0), (255, 0, 255), (0, 255, 255)];
const COLORS: &[(u8, u8, u8)] = concat_slices!([(0, 0, 0); (u8, u8, u8)]: PRIMARIES, SECONDARIES);
const COLORS: &[(u8, u8, u8)] = concat_slices!([(u8, u8, u8)]: PRIMARIES, SECONDARIES);
```

[`std::concat!`]: core::concat
Expand Down

0 comments on commit 9fbb396

Please sign in to comment.