Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some clippy warnings #924

Merged
merged 2 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/bridge/gateway/shard_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl ShardRunner {
self.shard.chunk_guilds(
guild_ids,
limit,
query.as_ref().map(String::as_str),
query.as_deref(),
).is_ok()
},
ShardClientMessage::Runner(ShardRunnerMessage::Close(code, reason)) => {
Expand Down
2 changes: 1 addition & 1 deletion src/framework/standard/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn to_lowercase<'a>(config: &Configuration, s: &'a str) -> Cow<'a, str> {
///
/// [`Configuration::on_mention`]: ../struct.Configuration.html#method.on_mention
pub fn mention<'a>(stream: &mut Stream<'a>, config: &Configuration) -> Option<&'a str> {
let on_mention = config.on_mention.as_ref().map(String::as_str)?;
let on_mention = config.on_mention.as_deref()?;

let start = stream.offset();

Expand Down
2 changes: 1 addition & 1 deletion src/model/channel/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Group {
match self.name {
Some(ref name) => Cow::Borrowed(name),
None => {
let mut name = match self.recipients.values().nth(0) {
let mut name = match self.recipients.values().next() {
Some(recipient) => recipient.with(|c| c.name.clone()),
None => return Cow::Borrowed("Empty Group"),
};
Expand Down