|
#[derive()] |
|
pub struct RelativePath { |
|
inner: BStr, |
|
} |
|
|
|
impl RelativePath { |
|
fn new_unchecked(value: &BStr) -> Result<&RelativePath, Error> { |
|
// SAFETY: `RelativePath` is transparent and equivalent to a `&BStr` if provided as reference. |
|
#[allow(unsafe_code)] |
|
unsafe { |
|
std::mem::transmute(value) |
|
} |
The unsafe code here is incorrect.
Furthermore, I don't actually think we can assume much about Result's layout there.
gitoxide/gix-path/src/relative_path.rs
Lines 15 to 19 in 0052e42
gitoxide/gix-path/src/relative_path.rs
Lines 29 to 35 in 0052e42
The unsafe code here is incorrect.
Furthermore, I don't actually think we can assume much about
Result's layout there.