mirror of
https://github.com/openharmony/third_party_rust_os_str_bytes.git
synced 2026-07-19 17:13:33 -04:00
Run clippy
This commit is contained in:
@@ -19,7 +19,7 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- run: cargo build
|
||||
- run: cargo clippy
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
|
||||
@@ -21,6 +21,7 @@ fn random_os_string(buffer_length: usize) -> Result<OsString, GetRandomError> {
|
||||
{
|
||||
// SAFETY: These bytes are random, so their values are arbitrary.
|
||||
getrandom(unsafe {
|
||||
#[allow(clippy::transmute_ptr_to_ptr)]
|
||||
::std::mem::transmute::<&mut [u16], &mut [u8]>(&mut buffer)
|
||||
})?;
|
||||
Ok(::std::os::windows::ffi::OsStringExt::from_wide(&buffer))
|
||||
|
||||
Reference in New Issue
Block a user