-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes feature compilation for docs.rs by favoring diesel2 if feature …
…specified (#536)
- Loading branch information
Showing
6 changed files
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ use diesel::{ | |
use std::io::Write; | ||
use std::str::FromStr; | ||
|
||
#[cfg(feature = "diesel1")] | ||
#[cfg(all(feature = "diesel1", not(feature = "diesel2")))] | ||
impl ToSql<Numeric, Mysql> for Decimal { | ||
fn to_sql<W: Write>(&self, out: &mut Output<W, Mysql>) -> serialize::Result { | ||
write!(out, "{}", *self).map(|_| IsNull::No).map_err(|e| e.into()) | ||
|
@@ -22,7 +22,7 @@ impl ToSql<Numeric, Mysql> for Decimal { | |
} | ||
} | ||
|
||
#[cfg(feature = "diesel1")] | ||
#[cfg(all(feature = "diesel1", not(feature = "diesel2")))] | ||
impl FromSql<Numeric, Mysql> for Decimal { | ||
fn from_sql(numeric: Option<&[u8]>) -> deserialize::Result<Self> { | ||
// From what I can ascertain, MySQL simply reads from a string format for the Decimal type. | ||
|
@@ -95,7 +95,7 @@ mod tests { | |
"mysql://[email protected]/mysql".to_string() | ||
} | ||
|
||
#[cfg(feature = "diesel1")] | ||
#[cfg(all(feature = "diesel1", not(feature = "diesel2")))] | ||
mod diesel1 { | ||
use super::*; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters