jfernandez / pmapi-rs

Safe and idiomatic wrapper for the Performance Metrics API (PMAPI)
GNU Lesser General Public License v2.1
2 stars 1 forks source link

build-error:mismatched types #1

Open blackStar1314 opened 4 weeks ago

blackStar1314 commented 4 weeks ago
problem: error[E0308]: mismatched types --> src/name.rs:24:13 22 pmLookupName( ------------ arguments to this function are incorrect 23 1, 24 &mut c_metric_name_ptr as mut const c_char, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
  = note: expected raw pointer `*mut *mut i8`
             found raw pointer `*mut *const i8

rustup env: stable-x86_64-unknown-linux-gnu (default) rustc 1.81.0 (eeb90cda1 2024-09-04)

fix: let mut c_metric_name_ptr = c_metric_name.as_ptr() as *mut c_char;

jfernandez commented 3 weeks ago

@blackStar1314 could you please submit a PR?

blackStar1314 commented 3 weeks ago

OK!