Skip to content

Commit

Permalink
Document the NormalizeOpts Default impl better
Browse files Browse the repository at this point in the history
Document that the Default impl of the normalize::NormalizeOpts type
disables all options, as it is not obvious how it behaves otherwise.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o committed Feb 26, 2025
1 parent 6b4d772 commit fc9ae43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/normalize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub(crate) use user::Handler;


/// Options influencing the address normalization process.
///
/// By default all options are disabled.
#[derive(Clone, Debug, Default)]
pub struct NormalizeOpts {
/// Whether or not addresses are sorted (in ascending order) already.
Expand Down
7 changes: 1 addition & 6 deletions tests/suite/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,7 @@ fn normalize_no_self_vma_path_reporting() {

fn normalize_permissionless_impl(pid: Pid, addr: Addr, test_lib: &Path) {
let normalizer = Normalizer::builder().enable_build_ids(true).build();
let opts = NormalizeOpts {
sorted_addrs: false,
map_files: false,
_non_exhaustive: (),
};

let opts = NormalizeOpts::default();
let normalized = normalizer
.normalize_user_addrs_opts(pid, &[addr], &opts)
.unwrap();
Expand Down

0 comments on commit fc9ae43

Please sign in to comment.