diff options
| author | Austin Hellyer <[email protected]> | 2016-11-19 21:55:02 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-19 21:55:02 -0800 |
| commit | 9581588164f044dceb11e9efae18bac385e7199e (patch) | |
| tree | 8af3bd51693705335db55af02f5a4fe9af5edb68 /src/model | |
| parent | Rename state methods from find_ to get_ (diff) | |
| download | serenity-9581588164f044dceb11e9efae18bac385e7199e.tar.xz serenity-9581588164f044dceb11e9efae18bac385e7199e.zip | |
Rework contextual presence methods
Rework the methods to accept strings and games directly, rather than
Optional values. Instead, use the new `reset_presence` to set a clean
status, or `set_presence` for more fine-grained control.
In addition, `Game::playing` and `Game::streaming` now accept `&str`s
rather than Strings.
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/gateway.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs index 29dd7ce..5fdfdfe 100644 --- a/src/model/gateway.rs +++ b/src/model/gateway.rs @@ -762,20 +762,20 @@ impl Event { impl Game { #[cfg(feature="methods")] - pub fn playing(name: String) -> Game { + pub fn playing(name: &str) -> Game { Game { kind: GameType::Playing, - name: name, + name: name.to_owned(), url: None, } } #[cfg(feature="methods")] - pub fn streaming(name: String, url: String) -> Game { + pub fn streaming(name: &str, url: &str) -> Game { Game { kind: GameType::Streaming, - name: name, - url: Some(url), + name: name.to_owned(), + url: Some(url.to_owned()), } } |