Use iterator instead of index loop in walk result parsing
This commit is contained in:
parent
36f89ddef3
commit
2850f4f68f
1 changed files with 1 additions and 3 deletions
|
|
@ -453,9 +453,7 @@ impl SnmpSession {
|
||||||
|
|
||||||
// Convert C results to Rust
|
// Convert C results to Rust
|
||||||
let mut parsed_results = Vec::with_capacity(num_results);
|
let mut parsed_results = Vec::with_capacity(num_results);
|
||||||
for i in 0..num_results {
|
for res in results_buf.iter().take(num_results) {
|
||||||
let res = &results_buf[i];
|
|
||||||
|
|
||||||
// Parse OID string
|
// Parse OID string
|
||||||
let oid_str = CStr::from_ptr(res.oid.as_ptr() as *const i8)
|
let oid_str = CStr::from_ptr(res.oid.as_ptr() as *const i8)
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue