Skip to content

Commit 863a295

Browse files
committed
Upgrade socket2 and log
1 parent 89d39cc commit 863a295

File tree

5 files changed

+40
-32
lines changed

5 files changed

+40
-32
lines changed

codegen/src/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
extern crate linked_hash_map;
2+
extern crate marksman_escape;
13
extern crate phf_codegen;
24
extern crate regex;
3-
extern crate marksman_escape;
4-
extern crate linked_hash_map;
55

6+
#[allow(unused_imports)]
67
use std::ascii::AsciiExt;
78
use std::path::Path;
89

codegen/src/type_gen.rs

+30-24
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use regex::Regex;
2+
#[allow(unused_imports)]
23
use std::ascii::AsciiExt;
34
use std::collections::BTreeMap;
45
use std::fs::File;
5-
use std::io::{Write, BufWriter};
6+
use std::io::{BufWriter, Write};
67
use std::path::Path;
78
use marksman_escape::Escape;
89

@@ -164,12 +165,13 @@ pub enum Inner {{"
164165
}
165166

166167
fn make_impl(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
167-
write!(w,
168-
"impl Inner {{
168+
write!(
169+
w,
170+
"impl Inner {{
169171
pub fn from_oid(oid: Oid) -> Option<Inner> {{
170172
match oid {{
171173
",
172-
).unwrap();
174+
).unwrap();
173175

174176
for (oid, type_) in types {
175177
write!(
@@ -181,15 +183,16 @@ fn make_impl(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
181183
).unwrap();
182184
}
183185

184-
write!(w,
185-
" _ => None,
186+
write!(
187+
w,
188+
" _ => None,
186189
}}
187190
}}
188191
189192
pub fn oid(&self) -> Oid {{
190193
match *self {{
191194
",
192-
).unwrap();
195+
).unwrap();
193196

194197

195198
for (oid, type_) in types {
@@ -202,15 +205,16 @@ fn make_impl(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
202205
).unwrap();
203206
}
204207

205-
write!(w,
206-
" Inner::Other(ref u) => u.oid,
208+
write!(
209+
w,
210+
" Inner::Other(ref u) => u.oid,
207211
}}
208212
}}
209213
210214
pub fn kind(&self) -> &Kind {{
211215
match *self {{
212216
",
213-
).unwrap();
217+
).unwrap();
214218

215219
for type_ in types.values() {
216220
let kind = match type_.kind {
@@ -232,15 +236,16 @@ fn make_impl(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
232236
).unwrap();
233237
}
234238

235-
write!(w,
236-
r#" Inner::Other(ref u) => &u.kind,
239+
write!(
240+
w,
241+
r#" Inner::Other(ref u) => &u.kind,
237242
}}
238243
}}
239244
240245
pub fn name(&self) -> &str {{
241246
match *self {{
242247
"#,
243-
).unwrap();
248+
).unwrap();
244249

245250
for type_ in types.values() {
246251
write!(
@@ -263,25 +268,26 @@ r#" Inner::Other(ref u) => &u.kind,
263268
}
264269

265270
fn make_consts(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
266-
write!(w,
267-
"pub mod consts {{
271+
write!(
272+
w,
273+
"pub mod consts {{
268274
use types::Type;
269275
use types::type_gen::Inner;
270276
",
271-
).unwrap();
277+
).unwrap();
272278

273279
for type_ in types.values() {
274-
write!(w,
275-
"
280+
write!(
281+
w,
282+
"
276283
/// {docs}
277284
pub const {ident}: Type = Type(Inner::{variant});
278285
",
279-
docs = type_.doc,
280-
ident = type_.ident,
281-
variant = type_.variant).unwrap();
286+
docs = type_.doc,
287+
ident = type_.ident,
288+
variant = type_.variant
289+
).unwrap();
282290
}
283291

284-
write!(w,
285-
"}}"
286-
).unwrap();
292+
write!(w, "}}").unwrap();
287293
}

postgres-shared/src/rows.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use fallible_iterator::FallibleIterator;
22
use postgres_protocol::message::backend::DataRowBody;
3+
#[allow(unused_imports)]
34
use std::ascii::AsciiExt;
45
use std::io;
56
use std::ops::Range;
@@ -43,9 +44,8 @@ impl Sealed for str {
4344
// FIXME ASCII-only case insensitivity isn't really the right thing to
4445
// do. Postgres itself uses a dubious wrapper around tolower and JDBC
4546
// uses the US locale.
46-
stmt.iter().position(
47-
|d| d.name().eq_ignore_ascii_case(self),
48-
)
47+
stmt.iter()
48+
.position(|d| d.name().eq_ignore_ascii_case(self))
4949
}
5050
}
5151

postgres/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ no-logging = []
5858
[dependencies]
5959
bytes = "0.4"
6060
fallible-iterator = "0.1.3"
61-
log = "0.3"
62-
socket2 = "0.2"
61+
log = "0.4"
62+
socket2 = "0.3"
6363

6464
openssl = { version = "0.9.2", optional = true }
6565
native-tls = { version = "0.1", optional = true }

postgres/src/transaction.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
33
use std::cell::Cell;
44
use std::fmt;
5+
#[allow(unused_imports)]
56
use std::ascii::AsciiExt;
67

7-
use {bad_response, Result, Connection};
8+
use {bad_response, Connection, Result};
89
use rows::Rows;
910
use stmt::Statement;
1011
use types::ToSql;

0 commit comments

Comments
 (0)