Skip to content

Commit 1a66269

Browse files
p-alikthomasmost
andcommitted
Upgrade mysqlclient-sys dependency to 0.2.5
* update diesel/Cargo.toml * remove obsolete windows checks Co-authored-by: Thomas Constantine Moore <[email protected]>
1 parent 18bc18a commit 1a66269

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

diesel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ byteorder = { version = "1.0", optional = true }
1717
chrono = { version = "0.4.19", optional = true, default-features = false, features = ["clock", "std"] }
1818
libc = { version = "0.2.0", optional = true }
1919
libsqlite3-sys = { version = ">=0.17.2, <0.24.0", optional = true, features = ["bundled_bindings"] }
20-
mysqlclient-sys = { version = "0.2.2", optional = true }
20+
mysqlclient-sys = { version = "0.2.5", optional = true }
2121
pq-sys = { version = "0.4.0", optional = true }
2222
quickcheck = { version = "1.0.3", optional = true }
2323
serde_json = { version = ">=0.8.0, <2.0", optional = true }

diesel/src/mysql/connection/raw.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@ impl RawConnection {
4848
let unix_socket = connection_options.unix_socket();
4949
let client_flags = connection_options.client_flags();
5050

51-
#[cfg(not(windows))]
52-
// allow single_match because compiler complains about if after cfg
53-
// error: attributes are not yet allowed on `if` expressions
54-
#[allow(clippy::single_match)]
55-
match connection_options.ssl_mode() {
56-
Some(ssl_mode) => self.set_ssl_mode(ssl_mode),
57-
_ => (),
51+
if let Some(ssl_mode) = connection_options.ssl_mode() {
52+
self.set_ssl_mode(ssl_mode)
5853
}
5954

6055
unsafe {
@@ -190,7 +185,6 @@ impl RawConnection {
190185
self.did_an_error_occur()
191186
}
192187

193-
#[cfg(not(windows))]
194188
fn set_ssl_mode(&self, ssl_mode: mysqlclient_sys::mysql_ssl_mode) {
195189
let v = ssl_mode as u32;
196190
let v_ptr: *const u32 = &v;

diesel/src/mysql/connection/url.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::ffi::{CStr, CString};
88

99
use crate::result::{ConnectionError, ConnectionResult};
1010

11-
#[cfg(not(windows))]
1211
use mysqlclient_sys::mysql_ssl_mode;
1312

1413
bitflags::bitflags! {
@@ -49,7 +48,6 @@ pub struct ConnectionOptions {
4948
port: Option<u16>,
5049
unix_socket: Option<CString>,
5150
client_flags: CapabilityFlags,
52-
#[cfg(not(windows))]
5351
ssl_mode: Option<mysql_ssl_mode>,
5452
}
5553

@@ -78,7 +76,6 @@ impl ConnectionOptions {
7876
_ => None,
7977
};
8078

81-
#[cfg(not(windows))]
8279
let ssl_mode = match query_pairs.get("ssl_mode") {
8380
Some(v) => {
8481
let ssl_mode = match v.to_lowercase().as_str() {
@@ -125,7 +122,6 @@ impl ConnectionOptions {
125122
port: url.port(),
126123
unix_socket: unix_socket,
127124
client_flags: client_flags,
128-
#[cfg(not(windows))]
129125
ssl_mode: ssl_mode,
130126
})
131127
}
@@ -158,7 +154,6 @@ impl ConnectionOptions {
158154
self.client_flags
159155
}
160156

161-
#[cfg(not(windows))]
162157
pub fn ssl_mode(&self) -> Option<mysql_ssl_mode> {
163158
self.ssl_mode
164159
}
@@ -298,7 +293,6 @@ fn unix_socket_tests() {
298293
);
299294
}
300295

301-
#[cfg(not(windows))]
302296
#[test]
303297
fn ssl_mode() {
304298
let ssl_mode = |url| ConnectionOptions::parse(url).unwrap().ssl_mode();

0 commit comments

Comments
 (0)