aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-08-18 20:50:23 -0700
committerZeyla Hellyer <[email protected]>2017-08-18 20:50:23 -0700
commitea72d05cf755d06d5c7da190e5d240fe4d77038c (patch)
tree9cf159a0b15c7819f2dfc2fb20e9c6d62dbf152b /src
parentClippy lints (diff)
downloadserenity-ea72d05cf755d06d5c7da190e5d240fe4d77038c.tar.xz
serenity-ea72d05cf755d06d5c7da190e5d240fe4d77038c.zip
Fix rustfmt lines that are too long
Apparently rustfmt can't fix some of these, causing it to exit with 3 and therefore failing the build.
Diffstat (limited to 'src')
-rw-r--r--src/framework/mod.rs36
-rw-r--r--src/http/ratelimiting.rs4
-rw-r--r--src/internal/macros.rs3
-rw-r--r--src/model/guild/guild_id.rs4
-rw-r--r--src/model/guild/member.rs2
-rw-r--r--src/model/user.rs3
6 files changed, 41 insertions, 11 deletions
diff --git a/src/framework/mod.rs b/src/framework/mod.rs
index 795dee0..1f62e1b 100644
--- a/src/framework/mod.rs
+++ b/src/framework/mod.rs
@@ -122,7 +122,11 @@ use model::Channel;
macro_rules! command {
($fname:ident($c:ident) $b:block) => {
#[allow(unreachable_code, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, _: &$crate::model::Message, _: Vec<String>, _: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ _: &$crate::model::Message,
+ _: Vec<String>,
+ _: String)
+ -> ::std::result::Result<(), String> {
$b
Ok(())
@@ -130,7 +134,11 @@ macro_rules! command {
};
($fname:ident($c:ident, $m:ident) $b:block) => {
#[allow(unreachable_code, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, _: Vec<String>, _: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ $m: &$crate::model::Message,
+ _: Vec<String>,
+ _: String)
+ -> ::std::result::Result<(), String> {
$b
Ok(())
@@ -138,7 +146,11 @@ macro_rules! command {
};
($fname:ident($c:ident, $m:ident, $a:ident) $b:block) => {
#[allow(unreachable_code, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, $a: Vec<String>, _: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ $m: &$crate::model::Message,
+ $a: Vec<String>,
+ _: String)
+ -> ::std::result::Result<(), String> {
$b
Ok(())
@@ -146,7 +158,11 @@ macro_rules! command {
};
($fname:ident($c:ident, $m:ident, @$a:ident) $b:block) => {
#[allow(unreachable_code, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, _: Vec<String>, $a: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ $m: &$crate::model::Message,
+ _: Vec<String>,
+ $a: String)
+ -> ::std::result::Result<(), String> {
$b
Ok(())
@@ -154,7 +170,11 @@ macro_rules! command {
};
($fname:ident($c:ident, $m:ident, $a:ident, @$f:ident) $b:block) => {
#[allow(unreachable_code, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, $a: Vec<String>, $f: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ $m: &$crate::model::Message,
+ $a: Vec<String>,
+ $f: String)
+ -> ::std::result::Result<(), String> {
$b
Ok(())
@@ -162,7 +182,11 @@ macro_rules! command {
};
($fname:ident($c:ident, $m:ident, $a:ident, $($name:ident: $t:ty),*) $b:block) => {
#[allow(unreachable_code, unreachable_patterns, unused_mut)]
- pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, $a: Vec<String>, _: String) -> ::std::result::Result<(), String> {
+ pub fn $fname(mut $c: &mut $crate::client::Context,
+ $m: &$crate::model::Message,
+ $a: Vec<String>,
+ _: String)
+ -> ::std::result::Result<(), String> {
let mut i = $a.iter();
let mut arg_counter = 0;
diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs
index 382661c..039f15d 100644
--- a/src/http/ratelimiting.rs
+++ b/src/http/ratelimiting.rs
@@ -89,7 +89,9 @@ lazy_static! {
///
/// [`RateLimit`]: struct.RateLimit.html
/// [`Route`]: enum.Route.html
- pub static ref ROUTES: Arc<Mutex<HashMap<Route, Arc<Mutex<RateLimit>>>>> = Arc::new(Mutex::new(HashMap::default()));
+ pub static ref ROUTES: Arc<Mutex<HashMap<Route, Arc<Mutex<RateLimit>>>>> = {
+ Arc::new(Mutex::new(HashMap::default()))
+ };
}
/// A representation of all routes registered within the library. These are safe
diff --git a/src/internal/macros.rs b/src/internal/macros.rs
index 7672316..124aa04 100644
--- a/src/internal/macros.rs
+++ b/src/internal/macros.rs
@@ -151,7 +151,8 @@ macro_rules! enum_number {
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = $name;
- fn expecting(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+ fn expecting(&self, formatter: &mut ::std::fmt::Formatter)
+ -> ::std::fmt::Result {
formatter.write_str("positive integer")
}
diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs
index 5bad3ab..4d6ba9b 100644
--- a/src/model/guild/guild_id.rs
+++ b/src/model/guild/guild_id.rs
@@ -15,7 +15,9 @@ use internal::prelude::*;
impl GuildId {
/// Converts the guild Id into the default channel's Id.
#[inline]
- #[deprecated(note = "The concept of default channels is no more, use `Guild::default_channel{_guaranteed}` to simulate the concept.")]
+ #[deprecated(note = "The concept of default channels is no more, use \
+ `Guild::default_channel{_guaranteed}` to simulate the
+ concept.")]
pub fn as_channel_id(&self) -> ChannelId { ChannelId(self.0) }
/// Ban a [`User`] from the guild. All messages by the
diff --git a/src/model/guild/member.rs b/src/model/guild/member.rs
index 819a4e9..f1a5114 100644
--- a/src/model/guild/member.rs
+++ b/src/model/guild/member.rs
@@ -280,7 +280,7 @@ impl Member {
pub fn permissions(&self) -> Result<Permissions> {
let guild = match self.guild_id.find() {
Some(guild) => guild,
- None => return Err(From::from(ModelError::GuildNotFound)),
+ None => return Err(From::from(ModelError::GuildNotFound)),
};
let guild = guild.read().unwrap();
diff --git a/src/model/user.rs b/src/model/user.rs
index 7d26fd4..d3cb72d 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -172,7 +172,8 @@ impl CurrentUser {
/// },
/// };
///
- /// assert_eq!(url, "https://discordapp.com/api/oauth2/authorize?client_id=249608697955745802&scope=bot");
+ /// assert_eq!(url, "https://discordapp.com/api/oauth2/authorize? \
+ /// client_id=249608697955745802&scope=bot");
/// ```
///
/// Get the invite url with some basic permissions set: