Skip to content

Commit

Permalink
Merge pull request #136 from afranchuk/nonzero-msrv
Browse files Browse the repository at this point in the history
Use NonZeroUsize rather than generic NonZero, which is a fairly recent addition.
  • Loading branch information
gabrielesvelto authored Sep 17, 2024
2 parents 771cabf + 99bba88 commit f9af785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/linux/mem_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl MemReader {
pub fn read_to_vec(
&mut self,
src: usize,
length: std::num::NonZero<usize>,
length: std::num::NonZeroUsize,
) -> Result<Vec<u8>, CopyFromProcessError> {
let length = length.into();
let layout =
Expand Down Expand Up @@ -258,7 +258,7 @@ impl PtraceDumper {
src: usize,
length: usize,
) -> Result<Vec<u8>, crate::errors::DumperError> {
let length = std::num::NonZero::new(length).ok_or_else(|| {
let length = std::num::NonZeroUsize::new(length).ok_or_else(|| {
crate::errors::DumperError::CopyFromProcessError(CopyFromProcessError {
src,
child: pid,
Expand Down
2 changes: 1 addition & 1 deletion src/linux/module_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'buf> ProcessMemory<'buf> {
match self {
Self::Process(pr) => {
let error = |e| error(Some(pr.start_address), e);
let len = std::num::NonZero::new(length as usize)
let len = std::num::NonZeroUsize::new(length as usize)
.ok_or_else(|| error(nix::Error::EINVAL))?;
let proc_offset = pr
.start_address
Expand Down

0 comments on commit f9af785

Please sign in to comment.