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

NVIDIA / nvrc / 20922293118

12 Jan 2026 02:08PM UTC coverage: 89.716% (+0.6%) from 89.12%
20922293118

Pull #101

github

web-flow
Merge 279bb61e2 into 1fb15ced7
Pull Request #101: hardened_std: implement UnixDatagram for syslog support

150 of 163 new or added lines in 1 file covered. (92.02%)

2 existing lines in 2 files now uncovered.

1867 of 2081 relevant lines covered (89.72%)

11.65 hits per line

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

0.0
/hardened_std/src/path.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright (c) NVIDIA CORPORATION
3

4
//! Path handling with minimal allocation
5

6
use alloc::string::String;
7

8
/// Path reference (unsized)
9
#[repr(transparent)]
10
pub struct Path {
11
    inner: str,
12
}
13

14
impl Path {
15
    /// Create a Path reference from a string reference.
16
    ///
17
    /// # Lifetime
18
    /// The returned Path reference has the same lifetime as the input string.
19
    /// This is safe because Path is repr(transparent) over str.
20
    pub fn new<S: AsRef<str> + ?Sized>(s: &S) -> &Path {
×
21
        // SAFETY: Path is repr(transparent) over str, so they have identical memory layout.
22
        // The pointer cast is safe, and the lifetime relationship ensures the Path reference
23
        // cannot outlive the source string.
24
        unsafe { &*(s.as_ref() as *const str as *const Path) }
×
25
    }
×
26

27
    pub fn as_str(&self) -> &str {
×
28
        &self.inner
×
29
    }
×
30
}
31

32
impl AsRef<str> for Path {
33
    fn as_ref(&self) -> &str {
×
34
        &self.inner
×
35
    }
×
36
}
37

38
/// Owned path buffer
39
pub struct PathBuf {
40
    #[allow(dead_code)]
41
    inner: String,
42
}
43

44
impl PathBuf {
45
    /// Create an empty PathBuf
46
    pub fn new() -> Self {
×
47
        Self {
×
48
            inner: String::new(),
×
49
        }
×
50
    }
×
51
}
52

53
impl Default for PathBuf {
54
    fn default() -> Self {
×
55
        Self::new()
×
UNCOV
56
    }
×
57
}
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