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

NVIDIA / nvrc / 20905384273

12 Jan 2026 01:29AM UTC coverage: 89.713% (-7.9%) from 97.582%
20905384273

Pull #98

github

web-flow
Merge 7e2e2b7f8 into 4da950f83
Pull Request #98: hardened_std: reduce the attack surface

376 of 510 new or added lines in 14 files covered. (73.73%)

1 existing line in 1 file now uncovered.

1439 of 1604 relevant lines covered (89.71%)

14.28 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.
NEW
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.
NEW
24
        unsafe { &*(s.as_ref() as *const str as *const Path) }
×
NEW
25
    }
×
26

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

32
impl AsRef<str> for Path {
NEW
33
    fn as_ref(&self) -> &str {
×
NEW
34
        &self.inner
×
NEW
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
NEW
46
    pub fn new() -> Self {
×
NEW
47
        Self {
×
NEW
48
            inner: String::new(),
×
NEW
49
        }
×
NEW
50
    }
×
51
}
52

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