Skip to content

Commit

Permalink
Fix clippy warnings (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelc committed Nov 19, 2020
1 parent c38459b commit 7ad3abe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/model/event.rs
Expand Up @@ -1455,7 +1455,7 @@ impl<'de> Deserialize<'de> for GatewayEvent {
.ok_or_else(|| DeError::custom("expected gateway event type"))
.and_then(EventType::deserialize)
.map_err(DeError::custom)?;
let payload = map.remove("d").ok_or_else(|| {
let payload = map.remove("d").ok_or({
Error::Decode("expected gateway event d", Value::Object(map))
}).map_err(DeError::custom)?;

Expand Down
2 changes: 1 addition & 1 deletion src/model/misc.rs
Expand Up @@ -201,7 +201,7 @@ impl EmojiIdentifier {
impl FromStr for EmojiIdentifier {
type Err = ();

fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_emoji(s).ok_or_else(|| ()) }
fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_emoji(s).ok_or(()) }
}


Expand Down
4 changes: 2 additions & 2 deletions src/utils/message_builder.rs
Expand Up @@ -1002,7 +1002,7 @@ impl EmbedMessageBuilding for MessageBuilder {
}

fn push_named_link_safe<T: I, U: I>(&mut self, name: T, url: U) -> &mut Self {
self.0.push_str("[");
self.0.push('[');
{
let mut c = name.into();
c.inner = normalize(&c.inner).replace("]", " ");
Expand All @@ -1014,7 +1014,7 @@ impl EmbedMessageBuilding for MessageBuilder {
c.inner = normalize(&c.inner).replace(")", " ");
self.0.push_str(&c.to_string());
}
self.0.push_str(")");
self.0.push(')');

self
}
Expand Down

0 comments on commit 7ad3abe

Please sign in to comment.