We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a35866 commit 844cd7aCopy full SHA for 844cd7a
src/graph.rs
@@ -669,10 +669,9 @@ impl Graph {
669
None => None,
670
Some(r) => Some(r?),
671
};
672
- // Don't use Option::map because the CStrings need to outlive the
673
- // pointers and Option::map consumes the Option.
674
- let output_names_ptrs: Option<Vec<*const c_char>> =
675
- output_names_cstrs.map(|slice| slice.iter().map(|s| s.as_ptr()).collect());
+ let output_names_ptrs: Option<Vec<*const c_char>> = output_names_cstrs
+ .as_ref()
+ .map(|slice| slice.iter().map(|s| s.as_ptr()).collect());
676
let output_names_ptrs_ptr = match &output_names_ptrs {
677
None => ptr::null(),
678
Some(ref v) => v.as_ptr(),
0 commit comments