Unverified Commit 9fb189c9 authored by Steven Fackler's avatar Steven Fackler Committed by GitHub
Browse files

Merge pull request #1619 from toy/fix-warnings

fix clippy warnings
parents 0c6b988f cbdffb05
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ fn basic() {
    assert_eq!(error.reason().unwrap(), "out of milk");
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        error.file().replace('\\', "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), line!() - 11);
@@ -49,7 +49,7 @@ fn static_data() {
    assert_eq!(error.reason().unwrap(), "out of bacon");
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        error.file().replace('\\', "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), line!() - 11);
@@ -66,7 +66,7 @@ fn dynamic_data() {
    assert_eq!(error.reason().unwrap(), "out of milk");
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        error.file().replace('\\', "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), line!() - 11);
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ fn env_inner(name: &str) -> Option<OsString> {
}

fn env(name: &str) -> Option<OsString> {
    let prefix = env::var("TARGET").unwrap().to_uppercase().replace("-", "_");
    let prefix = env::var("TARGET").unwrap().to_uppercase().replace('-', "_");
    let prefixed = format!("{}_{}", prefix, name);
    env_inner(&prefixed).or_else(|| env_inner(name))
}
+3 −3
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ cfg_if! {
            pub const fn ERR_GET_LIB(errcode: c_ulong) -> c_int {
                // hacks since `if` isn't yet stable in const functions :(
                ((ERR_LIB_SYS as c_ulong * (ERR_SYSTEM_ERROR(errcode) as c_ulong)) |
                (((errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK)) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong)) as c_int
                (((errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong))) as c_int
            }

            pub const fn ERR_GET_FUNC(_errcode: c_ulong) -> c_int {
@@ -38,12 +38,12 @@ cfg_if! {
            pub const fn ERR_GET_REASON(errcode: c_ulong) -> c_int {
                // hacks since `if` isn't yet stable in const functions :(
                ((ERR_LIB_SYS as c_ulong * (ERR_SYSTEM_ERROR(errcode) as c_ulong)) |
                ((errcode & ERR_REASON_MASK)) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong)) as c_int
                ((errcode & ERR_REASON_MASK) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong))) as c_int
            }

            pub const fn ERR_PACK(lib: c_int, _func: c_int, reason: c_int) -> c_ulong {
                ((lib as c_ulong & ERR_LIB_MASK) << ERR_LIB_OFFSET) |
                ((reason as c_ulong & ERR_REASON_MASK))
                (reason as c_ulong & ERR_REASON_MASK)
            }
        }
    } else {