Skip to content

Commit fec7286

Browse files
committed
use vec![] intead of Vec::new()
1 parent 5b496a1 commit fec7286

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ impl InnerPostgresConnection {
617617
ty: PostgresType::from_oid(type_oid)
618618
}
619619
}).collect(),
620-
NoData => Vec::new(),
620+
NoData => vec![],
621621
_ => unreachable!()
622622
};
623623

@@ -681,7 +681,7 @@ impl InnerPostgresConnection {
681681
check_desync!(self);
682682
try_pg!(self.write_messages([Query { query: query }]));
683683

684-
let mut result = Vec::new();
684+
let mut result = vec![];
685685
loop {
686686
match try_pg!(self.read_message()) {
687687
ReadyForQuery { .. } => break,
@@ -760,7 +760,7 @@ impl PostgresConnection {
760760
/// user: Some("postgres".to_owned()),
761761
/// password: None,
762762
/// database: None,
763-
/// options: Vec::new(),
763+
/// options: vec![],
764764
/// };
765765
/// let maybe_conn = PostgresConnection::connect(params, &NoSsl);
766766
/// ```
@@ -1091,8 +1091,8 @@ impl<'conn> PostgresStatement<'conn> {
10911091
actual: params.len(),
10921092
});
10931093
}
1094-
let mut formats = Vec::new();
1095-
let mut values = Vec::new();
1094+
let mut formats = vec![];
1095+
let mut values = vec![];
10961096
for (&param, ty) in params.iter().zip(self.param_types.iter()) {
10971097
let (format, value) = try!(param.to_sql(ty));
10981098
formats.push(format as i16);

src/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl<R: Reader> ReadMessage for R {
295295
}
296296

297297
fn read_fields(buf: &mut MemReader) -> IoResult<Vec<(u8, String)>> {
298-
let mut fields = Vec::new();
298+
let mut fields = vec![];
299299
loop {
300300
let ty = try!(buf.read_u8());
301301
if ty == 0 {

src/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl PostgresConnectionPool {
6161
let mut pool = InnerConnectionPool {
6262
params: try!(params.into_connect_params()),
6363
ssl: ssl,
64-
pool: Vec::new(),
64+
pool: vec![],
6565
};
6666

6767
for _ in range(0, pool_size) {

0 commit comments

Comments
 (0)