File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,14 @@ pub extern "C" fn ddog_get_traces_size(traces: &TracesBytes) -> usize {
142142// can return values as `Option<&/&mut>` that will have the same ABI `*const/*mut TraceBytes`, with
143143// `None` corresponding to `null`.
144144
145+ // I don't think we need to return a mutable reference here, but when changing the return value
146+ // from `*mut` to `Option<&mut>`, we wanted to preserve the FFI at first.
145147#[ no_mangle]
146- pub extern "C" fn ddog_get_trace ( traces : & mut TracesBytes , index : usize ) -> Option < & TraceBytes > {
147- traces. get ( index)
148+ pub extern "C" fn ddog_get_trace (
149+ traces : & mut TracesBytes ,
150+ index : usize ,
151+ ) -> Option < & mut TraceBytes > {
152+ traces. get_mut ( index)
148153}
149154
150155// ------------------ TraceBytes ------------------
@@ -159,9 +164,11 @@ pub extern "C" fn ddog_get_trace_size(trace: &TraceBytes) -> usize {
159164 trace. len ( )
160165}
161166
167+ // I don't think we need to return a mutable reference here, but when changing the return value
168+ // from `*mut` to `Option<&mut>`, we wanted to preserve the FFI at first.
162169#[ no_mangle]
163- pub extern "C" fn ddog_get_span ( trace : & mut TraceBytes , index : usize ) -> Option < & SpanBytes > {
164- trace. get ( index)
170+ pub extern "C" fn ddog_get_span ( trace : & mut TraceBytes , index : usize ) -> Option < & mut SpanBytes > {
171+ trace. get_mut ( index)
165172}
166173
167174// ------------------- SpanBytes -------------------
You can’t perform that action at this time.
0 commit comments