Skip to content

Commit f240fd2

Browse files
committed
rustfmt
1 parent cb30c80 commit f240fd2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/convert.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ use song::{self, Id, Song};
1111
use error::Error;
1212

1313
#[doc(hidden)]
14-
pub trait FromMap : Sized {
14+
pub trait FromMap: Sized {
1515
fn from_map(map: BTreeMap<String, String>) -> Result<Self, Error>;
1616
}
1717

1818
#[doc(hidden)]
19-
pub trait FromIter : Sized {
19+
pub trait FromIter: Sized {
2020
fn from_iter<I: Iterator<Item = Result<(String, String), Error>>>(iter: I) -> Result<Self, Error>;
2121
}
2222

@@ -100,7 +100,7 @@ pub trait IsId {
100100
}
101101
}
102102

103-
pub trait ToQueueRangeOrPlace : IsId {
103+
pub trait ToQueueRangeOrPlace: IsId {
104104
fn to_range(self) -> String;
105105
}
106106

@@ -162,7 +162,7 @@ impl ToQueueRangeOrPlace for RangeFull {
162162
}
163163
}
164164

165-
pub trait ToQueuePlace : IsId {
165+
pub trait ToQueuePlace: IsId {
166166
fn to_place(self) -> u32;
167167
}
168168

src/idle.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ use proto::Proto;
4040
pub enum Subsystem {
4141
/// database: the song database has been modified after update.
4242
Database,
43-
/// update: a database update has started or finished. If the database was modified during the update, the database event is also emitted.
43+
/// update: a database update has started or finished.
44+
/// If the database was modified during the update, the database event is also emitted.
4445
Update,
4546
/// stored_playlist: a stored playlist has been modified, renamed, created or deleted
4647
Playlist,
@@ -134,7 +135,7 @@ impl<'a, S: 'a + Read + Write> Drop for IdleGuard<'a, S> {
134135
/// See module's documentation for details.
135136
pub trait Idle {
136137
/// Stream type of a client
137-
type Stream: Read+Write;
138+
type Stream: Read + Write;
138139

139140
/// Start listening for events from a set of subsystems
140141
///

src/proto.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use convert::FromIter;
1212

1313
pub struct Pairs<I>(pub I);
1414

15-
impl<I> Iterator for Pairs<I> where I: Iterator<Item = io::Result<String>>
15+
impl<I> Iterator for Pairs<I>
16+
where I: Iterator<Item = io::Result<String>>
1617
{
1718
type Item = Result<(String, String)>;
1819
fn next(&mut self) -> Option<Result<(String, String)>> {
@@ -36,7 +37,8 @@ struct Maps<'a, I: 'a> {
3637
first: bool,
3738
}
3839

39-
impl<'a, I> Iterator for Maps<'a, I> where I: Iterator<Item = io::Result<String>>
40+
impl<'a, I> Iterator for Maps<'a, I>
41+
where I: Iterator<Item = io::Result<String>>
4042
{
4143
type Item = Result<BTreeMap<String, String>>;
4244
fn next(&mut self) -> Option<Result<BTreeMap<String, String>>> {
@@ -72,15 +74,12 @@ impl<'a, I> Iterator for Maps<'a, I> where I: Iterator<Item = io::Result<String>
7274
}
7375
}
7476

75-
if map.is_empty() {
76-
None
77-
} else {
78-
Some(Ok(map))
79-
}
77+
if map.is_empty() { None } else { Some(Ok(map)) }
8078
}
8179
}
8280

83-
impl<I> Pairs<I> where I: Iterator<Item = io::Result<String>>
81+
impl<I> Pairs<I>
82+
where I: Iterator<Item = io::Result<String>>
8483
{
8584
pub fn split<'a, 'b: 'a>(&'a mut self, f: &'b str) -> Maps<'a, I> {
8685
Maps {
@@ -96,7 +95,7 @@ impl<I> Pairs<I> where I: Iterator<Item = io::Result<String>>
9695
// Client inner communication methods {{{
9796
#[doc(hidden)]
9897
pub trait Proto {
99-
type Stream: Read+Write;
98+
type Stream: Read + Write;
10099

101100
fn read_line(&mut self) -> Result<String>;
102101
fn read_pairs(&mut self) -> Pairs<Lines<&mut BufStream<Self::Stream>>>;

0 commit comments

Comments
 (0)