Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd7b10f2

Browse files
committed
cleanup
1 parent09e8656 commitd7b10f2

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

‎postgres-types/src/lib.rs‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,9 @@ pub trait ToSql: fmt::Debug {
836836
) ->Result<IsNull,Box<dynError +Sync +Send>>;
837837

838838
/// Specify the encode format
839-
fnencode_format(&self) ->Format{Format::Binary}
839+
fnencode_format(&self) ->Format{
840+
Format::Binary
841+
}
840842
}
841843

842844
/// Supported Postgres message format types
@@ -849,17 +851,6 @@ pub enum Format {
849851
Binary,
850852
}
851853

852-
/// Convert from `Format` to the Postgres integer representation of those formats
853-
implFrom<Format>fori16{
854-
fnfrom(format:Format) ->Self{
855-
match format{
856-
Format::Text =>0,
857-
Format::Binary =>1,
858-
}
859-
}
860-
}
861-
862-
863854
impl<'a,T>ToSqlfor&'aT
864855
where
865856
T:ToSql,

‎tokio-postgres/src/query.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ where
156156
I:IntoIterator<Item =P>,
157157
I::IntoIter:ExactSizeIterator,
158158
{
159-
let(param_formats, params):(Vec<_>,Vec<_>) = params.into_iter().map(|p|->(i16,P){(p.borrow_to_sql().encode_format().into(),p)}).unzip();
159+
let(param_formats, params):(Vec<_>,Vec<_>) = params
160+
.into_iter()
161+
.map(|p|{(p.borrow_to_sql().encode_format()asi16, p)})
162+
.unzip();
160163
let params = params.into_iter();
161164

162165
assert!(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp