Skip to content

Commit df787a2

Browse files
committed
WIP
1 parent da4447b commit df787a2

5 files changed

Lines changed: 21 additions & 10 deletions

File tree

diesel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ipnetwork = ">=0.12.2, <0.19.0"
4444
quickcheck = "0.9"
4545

4646
[features]
47-
default = ["32-column-tables", "without-deprecated"]
47+
default = ["mysql", "postgres", "sqlite"]
4848
extras = ["chrono", "serde_json", "uuid", "network-address", "numeric", "r2d2"]
4949
unstable = ["diesel_derives/nightly"]
5050
large-tables = ["32-column-tables"]

diesel/src/mysql/connection/stmt/iterator.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub struct MysqlField<'a> {
157157
_marker: PhantomData<&'a (Binds, StatementMetadata)>,
158158
}
159159

160-
impl<'a> Field<Mysql> for MysqlField<'a> {
160+
impl<'a> Field<'a, Mysql> for MysqlField<'a> {
161161
fn field_name(&self) -> Option<&str> {
162162
self.metadata.fields()[self.idx].field_name()
163163
}
@@ -166,7 +166,10 @@ impl<'a> Field<Mysql> for MysqlField<'a> {
166166
(*self.bind)[self.idx].is_null()
167167
}
168168

169-
fn value<'b>(&'b self) -> Option<crate::backend::RawValue<'b, Mysql>> {
169+
fn value<'b>(&'b self) -> Option<crate::backend::RawValue<'b, Mysql>>
170+
where
171+
'a: 'b,
172+
{
170173
self.bind[self.idx].value()
171174
}
172175
}

diesel/src/pg/connection/row.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ pub struct PgField<'a> {
6464
col_idx: usize,
6565
}
6666

67-
impl<'a> Field<Pg> for PgField<'a> {
67+
impl<'a> Field<'a, Pg> for PgField<'a> {
6868
fn field_name(&self) -> Option<&str> {
6969
self.db_result.column_name(self.col_idx)
7070
}
7171

72-
fn value<'b>(&'b self) -> Option<crate::backend::RawValue<'b, Pg>> {
72+
fn value<'b>(&'b self) -> Option<crate::backend::RawValue<'b, Pg>>
73+
where
74+
'a: 'b,
75+
{
7376
let raw = self.db_result.get(self.row_idx, self.col_idx)?;
7477
let type_oid = self.db_result.column_type(self.col_idx);
7578

diesel/src/util/once_cell.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ use std::cell::UnsafeCell;
1313
/// # Examples
1414
///
1515
/// ```
16-
/// #![feature(once_cell)]
1716
///
18-
/// use std::lazy::OnceCell;
17+
/// use crate::lazy::OnceCell;
1918
///
2019
/// let cell = OnceCell::new();
2120
/// assert!(cell.get().is_none());
@@ -60,9 +59,8 @@ impl<T> OnceCell<T> {
6059
/// # Examples
6160
///
6261
/// ```
63-
/// #![feature(once_cell)]
6462
///
65-
/// use std::lazy::OnceCell;
63+
/// use crate::lazy::OnceCell;
6664
///
6765
/// let cell = OnceCell::new();
6866
/// assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));

diesel_bench/Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ autobenches = false
88

99
[workspace]
1010

11+
[workspace.profile.bench]
12+
opt-level = 3
13+
debug = true
14+
lto = true
15+
incremental = false
16+
codegen-units = 1
17+
1118
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1219

1320
[dependencies]
@@ -42,7 +49,7 @@ bench = true
4249
harness = false
4350

4451
[features]
45-
default = []
52+
default = ["sqlite"]
4653
postgres = ["diesel/postgres"]
4754
sqlite = ["diesel/sqlite"]
4855
mysql = ["diesel/mysql"]

0 commit comments

Comments
 (0)