From f4f6412fcb54f54df8667587de39fcb3c3781204 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Thu, 2 Jun 2016 00:05:57 -0400 Subject: [PATCH] Fix a few mutable types for `self` parameters. --- openssl/src/dh/mod.rs | 6 +++--- openssl/src/ssl/mod.rs | 6 +++--- openssl/src/ssl/tests/mod.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openssl/src/dh/mod.rs b/openssl/src/dh/mod.rs index 14bf076d9..bf1ca73e8 100644 --- a/openssl/src/dh/mod.rs +++ b/openssl/src/dh/mod.rs @@ -81,7 +81,7 @@ mod tests { #[test] #[cfg(feature = "rfc5114")] fn test_dh_rfc5114() { - let ctx = SslContext::new(Sslv23).unwrap(); + let mut ctx = SslContext::new(Sslv23).unwrap(); let dh1 = DH::get_1024_160().unwrap(); ctx.set_tmp_dh(dh1).unwrap(); let dh2 = DH::get_2048_224().unwrap(); @@ -92,7 +92,7 @@ mod tests { #[test] fn test_dh() { - let ctx = SslContext::new(Sslv23).unwrap(); + let mut ctx = SslContext::new(Sslv23).unwrap(); let p = BigNum::from_hex_str("87A8E61DB4B6663CFFBBD19C651959998CEEF608660DD0F25D2CEED4435\ E3B00E00DF8F1D61957D4FAF7DF4561B2AA3016C3D91134096FAA3BF429\ 6D830E9A7C209E0C6497517ABD5A8A9D306BCF67ED91F9E6725B4758C02\ @@ -122,7 +122,7 @@ mod tests { #[test] fn test_dh_from_pem() { - let ctx = SslContext::new(Sslv23).unwrap(); + let mut ctx = SslContext::new(Sslv23).unwrap(); let pem_path = Path::new("test/dhparams.pem"); let mut file = File::open(&pem_path) .ok() diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 5536a99e7..89a7f7d49 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -521,13 +521,13 @@ impl SslContext { } } - pub fn set_read_ahead(&self, m: u32) { + pub fn set_read_ahead(&mut self, m: u32) { unsafe { ffi_extras::SSL_CTX_set_read_ahead(self.ctx, m as c_long); } } - pub fn set_tmp_dh(&self, dh: DH) -> Result<(), ErrorStack> { + pub fn set_tmp_dh(&mut self, dh: DH) -> Result<(), ErrorStack> { wrap_ssl_result(unsafe { ffi_extras::SSL_CTX_set_tmp_dh(self.ctx, dh.raw()) as i32 }) } @@ -647,7 +647,7 @@ impl SslContext { SslContextOptions::from_bits(ret).unwrap() } - pub fn options(&mut self) -> SslContextOptions { + pub fn options(&self) -> SslContextOptions { let ret = unsafe { ffi_extras::SSL_CTX_get_options(self.ctx) }; SslContextOptions::from_bits(ret).unwrap() } diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs index cc376cf40..94bb4b4be 100644 --- a/openssl/src/ssl/tests/mod.rs +++ b/openssl/src/ssl/tests/mod.rs @@ -437,7 +437,7 @@ fn test_set_certificate_and_private_key() { } run_test!(get_ctx_options, |method, _| { - let mut ctx = SslContext::new(method).unwrap(); + let ctx = SslContext::new(method).unwrap(); ctx.options(); }); -- GitLab