diff options
| author | Zeyla Hellyer <[email protected]> | 2017-05-05 17:09:39 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-05-05 17:11:31 -0700 |
| commit | ae352ea3df86eb2d853d5b1af048a95409aafc38 (patch) | |
| tree | b5701ee38a917c2483b09628d0e2ccf981bc1058 /src/model/guild/partial_guild.rs | |
| parent | Add framework dynamic_prefix example (diff) | |
| download | serenity-ae352ea3df86eb2d853d5b1af048a95409aafc38.tar.xz serenity-ae352ea3df86eb2d853d5b1af048a95409aafc38.zip | |
Fix guild leaving result
When leaving a guild, `rest::leave_guild` would attempt to deserialize a
JSON body containing a partial amount of guild info, resulting in an
error:
```
Could not leave guild: Json(ErrorImpl { code: EofWhileParsingValue, line: 1, column: 0 })
```
Although the bot would still actually leave the guild, it would always
return this error.
To fix this, don't try to deserialize anything and only check for a 204
instead.
Diffstat (limited to 'src/model/guild/partial_guild.rs')
| -rw-r--r-- | src/model/guild/partial_guild.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 8c1113b..3635a7a 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -350,7 +350,7 @@ impl PartialGuild { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result<PartialGuild> { + pub fn leave(&self) -> Result<()> { self.id.leave() } |