• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16339747936

17 Jul 2025 08:09AM UTC coverage: 80.702% (-0.002%) from 80.704%
16339747936

push

github

web-flow
Use ptr::default in Rust 1.88 (#3896)

Signed-off-by: Nicholas Gates <nick@nickgates.com>

0 of 14 new or added lines in 5 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

41864 of 51875 relevant lines covered (80.7%)

157546.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/vortex-ffi/src/error.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::ptr;
5
use std::sync::Arc;
6

7
use vortex::error::VortexResult;
8

9
use crate::box_wrapper;
10
use crate::string::vx_string;
11

12
pub(crate) struct VortexError {
13
    message: Arc<str>,
14
}
15

16
box_wrapper!(
17
    /// The error structure populated by fallible Vortex C functions.
18
    VortexError,
19
    vx_error
20
);
21

22
#[inline]
NEW
23
pub fn try_or_default<T: Default>(
×
24
    error_out: *mut *mut vx_error,
×
25
    function: impl FnOnce() -> VortexResult<T>,
×
26
) -> T {
×
27
    match function() {
×
28
        Ok(value) => {
×
29
            unsafe { error_out.write(ptr::null_mut()) };
×
30
            value
×
31
        }
32
        Err(err) => {
×
33
            let err = vx_error::new(Box::new(VortexError {
×
34
                message: err.to_string().into(),
×
35
            }));
×
36
            unsafe { error_out.write(err) };
×
NEW
37
            T::default()
×
38
        }
39
    }
40
}
×
41

42
/// Returns a borrowed reference to the error message from the given Vortex error.
43
#[unsafe(no_mangle)]
44
pub unsafe extern "C-unwind" fn vx_error_get_message(error: *const vx_error) -> *const vx_string {
×
45
    vx_string::new_ref(&vx_error::as_ref(error).message)
×
46
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc