mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 19:15:45 -06:00
fix: use c-style strings instead of manual termination, cast pointer, use then_some
This commit is contained in:
@@ -107,7 +107,7 @@ impl Platform {
|
|||||||
debug!("File type: {file_type:?}, well known: {well_known}");
|
debug!("File type: {file_type:?}, well known: {well_known}");
|
||||||
|
|
||||||
// If it's anything recognizable and valid, assume that a parent process has setup an output stream
|
// If it's anything recognizable and valid, assume that a parent process has setup an output stream
|
||||||
Ok(well_known.then(|| file_type))
|
Ok(well_known.then_some(file_type))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to attach to parent console
|
/// Try to attach to parent console
|
||||||
@@ -128,7 +128,7 @@ impl Platform {
|
|||||||
.map_err(|e| PlatformError::ConsoleInit(format!("Failed to attach to parent console: {:?}", e)))?;
|
.map_err(|e| PlatformError::ConsoleInit(format!("Failed to attach to parent console: {:?}", e)))?;
|
||||||
|
|
||||||
let handle = unsafe {
|
let handle = unsafe {
|
||||||
let pcstr = PCSTR::from_raw("CONOUT$\0".as_ptr());
|
let pcstr = PCSTR::from_raw(c"CONOUT$".as_ptr() as *const u8);
|
||||||
CreateFileA::<PCSTR>(
|
CreateFileA::<PCSTR>(
|
||||||
pcstr,
|
pcstr,
|
||||||
(GENERIC_READ | GENERIC_WRITE).0,
|
(GENERIC_READ | GENERIC_WRITE).0,
|
||||||
|
|||||||
Reference in New Issue
Block a user