Skip to content

Commit

Permalink
Silence deprecation warning for Windows (#36)
Browse files Browse the repository at this point in the history
`trim_right` is deprecated in favor of `trim_end`, but the latter requires Rust ≥ 1.30.
  • Loading branch information
lambda-fairy authored Oct 27, 2021
1 parent 0bc5e44 commit 2a08434
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn with_description<F, T>(err: Errno, callback: F) -> T where

let msg = String::from_utf16_lossy(&buf[..res as usize]);
// Trim trailing CRLF inserted by FormatMessageW
#[allow(deprecated)] // TODO: remove when MSRV >= 1.30
callback(Ok(msg.trim_right()))
}
}
Expand Down

0 comments on commit 2a08434

Please sign in to comment.