diff options
| author | Austin Hellyer <[email protected]> | 2016-11-17 11:19:00 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-17 11:19:00 -0800 |
| commit | bdc319525396a36c029600a2cd9750e28633a805 (patch) | |
| tree | a01cf10c4946086fa7f9b36f589d588a2ad7a34a /examples | |
| parent | Decode discriminators as strings (diff) | |
| download | serenity-bdc319525396a36c029600a2cd9750e28633a805.tar.xz serenity-bdc319525396a36c029600a2cd9750e28633a805.zip | |
Allow Id/u64 equality comparisons
This will allow comparing, for example, a `ChannelId` with a `u64`
directly, bypassing the need to do something like:
```rust
let channel_id = ChannelId(7);
assert!(channel_id.0 == 7);
// can now be replaced with:
assert!(channel_id == 7);
```
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/06_command_framework.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/06_command_framework.rs b/examples/06_command_framework.rs index b93b952..c7300aa 100644 --- a/examples/06_command_framework.rs +++ b/examples/06_command_framework.rs @@ -55,7 +55,7 @@ fn ping_command(_context: Context, message: Message, _args: Vec<String>) { fn owner_check(_context: &Context, message: &Message) -> bool { // Replace 7 with your ID - message.author.id.0 == 7u64 + message.author.id == 7 } fn some_complex_command(context: Context, _msg: Message, args: Vec<String>) { |