Use iterator instead of index loop in walk result parsing

This commit is contained in:
Graham McIntire 2026-02-10 08:31:07 -06:00
parent 36f89ddef3
commit 2850f4f68f
No known key found for this signature in database

View file

@ -453,9 +453,7 @@ impl SnmpSession {
// Convert C results to Rust
let mut parsed_results = Vec::with_capacity(num_results);
for i in 0..num_results {
let res = &results_buf[i];
for res in results_buf.iter().take(num_results) {
// Parse OID string
let oid_str = CStr::from_ptr(res.oid.as_ptr() as *const i8)
.to_string_lossy()