Skip to content

Commit 8626154

Browse files
authored
fix: implement unimplemented &CString Arg functions (#1524)
1 parent 85f3888 commit 8626154

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/path/arg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,12 @@ impl Arg for &CStr {
513513
impl Arg for &CString {
514514
#[inline]
515515
fn as_str(&self) -> io::Result<&str> {
516-
unimplemented!()
516+
self.to_str().map_err(|_utf8_err| io::Errno::INVAL)
517517
}
518518

519519
#[inline]
520520
fn to_string_lossy(&self) -> Cow<'_, str> {
521-
unimplemented!()
521+
CStr::to_string_lossy(self)
522522
}
523523

524524
#[inline]

0 commit comments

Comments
 (0)