aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/version.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-07-15 21:46:11 -0700
committerSteven Fackler <[email protected]>2017-07-15 21:46:11 -0700
commitbcd0dcafcba31b7239faf1d582871f8fa83d69e9 (patch)
treef090be453d289f0f17ca4f6a3f458881e6f7091a /openssl/src/version.rs
parentInit before creating ex indexes (diff)
downloadrust-openssl-bcd0dcafcba31b7239faf1d582871f8fa83d69e9.tar.xz
rust-openssl-bcd0dcafcba31b7239faf1d582871f8fa83d69e9.zip
Rustfmt
Diffstat (limited to 'openssl/src/version.rs')
-rw-r--r--openssl/src/version.rs38
1 files changed, 31 insertions, 7 deletions
diff --git a/openssl/src/version.rs b/openssl/src/version.rs
index bf47695b..7254d7ba 100644
--- a/openssl/src/version.rs
+++ b/openssl/src/version.rs
@@ -54,28 +54,48 @@ pub fn number() -> i64 {
/// The text variant of the version number and the release date. For example, "OpenSSL 0.9.5a 1 Apr 2000".
pub fn version() -> &'static str {
- unsafe { CStr::from_ptr(OpenSSL_version(OPENSSL_VERSION)).to_str().unwrap() }
+ unsafe {
+ CStr::from_ptr(OpenSSL_version(OPENSSL_VERSION))
+ .to_str()
+ .unwrap()
+ }
}
/// The compiler flags set for the compilation process in the form "compiler: ..." if available or
/// "compiler: information not available" otherwise.
pub fn c_flags() -> &'static str {
- unsafe { CStr::from_ptr(OpenSSL_version(OPENSSL_CFLAGS)).to_str().unwrap() }
+ unsafe {
+ CStr::from_ptr(OpenSSL_version(OPENSSL_CFLAGS))
+ .to_str()
+ .unwrap()
+ }
}
/// The date of the build process in the form "built on: ..." if available or "built on: date not available" otherwise.
pub fn built_on() -> &'static str {
- unsafe { CStr::from_ptr(OpenSSL_version(OPENSSL_BUILT_ON)).to_str().unwrap() }
+ unsafe {
+ CStr::from_ptr(OpenSSL_version(OPENSSL_BUILT_ON))
+ .to_str()
+ .unwrap()
+ }
}
/// The "Configure" target of the library build in the form "platform: ..." if available or "platform: information not available" otherwise.
pub fn platform() -> &'static str {
- unsafe { CStr::from_ptr(OpenSSL_version(OPENSSL_PLATFORM)).to_str().unwrap() }
+ unsafe {
+ CStr::from_ptr(OpenSSL_version(OPENSSL_PLATFORM))
+ .to_str()
+ .unwrap()
+ }
}
/// The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "..."" if available or "OPENSSLDIR: N/A" otherwise.
pub fn dir() -> &'static str {
- unsafe { CStr::from_ptr(OpenSSL_version(OPENSSL_DIR)).to_str().unwrap() }
+ unsafe {
+ CStr::from_ptr(OpenSSL_version(OPENSSL_DIR))
+ .to_str()
+ .unwrap()
+ }
}
/// This test ensures that we do not segfault when calling the functions of this module
@@ -90,9 +110,13 @@ fn test_versions() {
println!("Dir: '{}'", dir());
#[cfg(not(libressl))]
- fn expected_name() -> &'static str { "OpenSSL" }
+ fn expected_name() -> &'static str {
+ "OpenSSL"
+ }
#[cfg(libressl)]
- fn expected_name() -> &'static str { "LibreSSL" }
+ fn expected_name() -> &'static str {
+ "LibreSSL"
+ }
assert!(number() > 0);
assert!(version().starts_with(expected_name()));