Eliminate build warnings
This PR contains (hopefully) trivial changes to eliminate build warnings.
Before:
C:\code\scrap>cargo build 2>&1 | find "warning"
warning: no edition set: defaulting to the 2015 edition while the latest is 2024
warning: unexpected `cfg` condition name: `quartz`
warning: unexpected `cfg` condition name: `quartz`
warning: unexpected `cfg` condition name: `x11`
warning: unexpected `cfg` condition name: `dxgi`
warning: unexpected `cfg` condition name: `dxgi`
warning: unexpected `cfg` condition name: `quartz`
warning: unexpected `cfg` condition name: `x11`
warning: unexpected `cfg` condition name: `dxgi`
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead
warning: type annotations needed
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
warning: taking a mutable reference to a `const` item
= note: this warning originates in the macro `ENUM` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: the type `DXGI_OUTDUPL_DESC` does not permit being left uninitialized
warning: the type `DXGI_OUTDUPL_FRAME_INFO` does not permit being left uninitialized
warning: the type `DXGI_MAPPED_RECT` does not permit being left uninitialized
warning: the type `DXGI_MAPPED_RECT` does not permit being left uninitialized
warning: the type `D3D11_TEXTURE2D_DESC` does not permit being left uninitialized
warning: the type `DXGI_OUTPUT_DESC` does not permit being left uninitialized
warning: `scrap` (lib) generated 22 warnings
C:\code\scrap>
After:
C:\code\scrap>cargo build 2>&1 | find "warning"
warning: no edition set: defaulting to the 2015 edition while the latest is 2024
C:\code\scrap>
Please be gentle and check that I haven't made any mistakes. I have experience with lots of languages but Rust isn't one of them. 😛
That final warning goes away with
edition = "2015"
...in Cargo.toml. I don't know enough about Rust to know if this is a safe change or not, though.
I guess it must be because the code doesn't compile at all with any of the other possible values. 😁
C:\code\scrap>cargo clean -p scrap
Removed 67 files, 9.0MiB total
C:\code\scrap>cargo build
Compiling scrap v0.5.0 (C:\code\scrap)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.68s
C:\code\scrap>
Oh wow, I was working on another project that uses Scrap and didn't realize it was using its own embedded copy of the code with many modifications and extensions, and when I came here to the source repo, I didn't notice that this project hasn't been updated in 6 years. 😛