diff --git a/src/client/rest/mod.rs b/src/client/rest/mod.rs index 1e032fd7ddd..31d7a17ae81 100644 --- a/src/client/rest/mod.rs +++ b/src/client/rest/mod.rs @@ -1341,13 +1341,8 @@ pub fn leave_group(guild_id: u64) -> Result { } /// Leaves a guild. -pub fn leave_guild(guild_id: u64) -> Result { - let response = request!(Route::UsersMeGuildsId, - delete, - "/users/@me/guilds/{}", - guild_id); - - serde_json::from_reader::(response).map_err(From::from) +pub fn leave_guild(guild_id: u64) -> Result<()> { + verify(204, request!(Route::UsersMeGuildsId, delete, "/users/@me/guilds/{}", guild_id)) } /// Deletes a user from group DM. diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index 6e5cb3a3b85..d1866ed9edd 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -356,7 +356,7 @@ impl GuildId { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result { + pub fn leave(&self) -> Result<()> { rest::leave_guild(self.0) } diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 0daeec1de40..6757d988dd8 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -642,7 +642,7 @@ impl Guild { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result { + pub fn leave(&self) -> Result<()> { self.id.leave() } diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 8c1113b8534..3635a7aaebf 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 { + pub fn leave(&self) -> Result<()> { self.id.leave() }