Use is_multiple_of instead of % == 0 (#3244)
I was reading the changelog of 1.87 and noticed that it's stable now. Realised that I saw a todo in the code :) https://releases.rs/docs/1.87.0/
This commit is contained in:
parent
bb24fb555b
commit
4763ada075
@ -724,8 +724,7 @@ impl IntelPTBuilder {
|
|||||||
|
|
||||||
/// Set the size of the perf aux buffer (actual PT traces buffer)
|
/// Set the size of the perf aux buffer (actual PT traces buffer)
|
||||||
pub fn perf_aux_buffer_size(mut self, perf_aux_buffer_size: usize) -> Result<Self, Error> {
|
pub fn perf_aux_buffer_size(mut self, perf_aux_buffer_size: usize) -> Result<Self, Error> {
|
||||||
// todo:replace with is_multiple_of once stable
|
if !perf_aux_buffer_size.is_multiple_of(PAGE_SIZE) {
|
||||||
if perf_aux_buffer_size % PAGE_SIZE != 0 {
|
|
||||||
return Err(Error::illegal_argument(
|
return Err(Error::illegal_argument(
|
||||||
"IntelPT perf_aux_buffer must be page aligned",
|
"IntelPT perf_aux_buffer must be page aligned",
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user