Show More
@@ -479,10 +479,11 impl Extend<u8> for HgPathBuf { | |||
|
479 | 479 | } |
|
480 | 480 | } |
|
481 | 481 | |
|
482 | /// Create a new [`OsString`] from types referenceable as [`HgPath`]. | |
|
483 | /// | |
|
482 | 484 | /// TODO: Once <https://www.mercurial-scm.org/wiki/WindowsUTF8Plan> is |
|
483 | 485 | /// implemented, these conversion utils will have to work differently depending |
|
484 | 486 | /// on the repository encoding: either `UTF-8` or `MBCS`. |
|
485 | ||
|
486 | 487 | pub fn hg_path_to_os_string<P: AsRef<HgPath>>( |
|
487 | 488 | hg_path: P, |
|
488 | 489 | ) -> Result<OsString, HgPathError> { |
@@ -498,12 +499,14 pub fn hg_path_to_os_string<P: AsRef<HgP | |||
|
498 | 499 | Ok(os_str.to_os_string()) |
|
499 | 500 | } |
|
500 | 501 | |
|
502 | /// Create a new [`PathBuf`] from types referenceable as [`HgPath`]. | |
|
501 | 503 | pub fn hg_path_to_path_buf<P: AsRef<HgPath>>( |
|
502 | 504 | hg_path: P, |
|
503 | 505 | ) -> Result<PathBuf, HgPathError> { |
|
504 | 506 | Ok(Path::new(&hg_path_to_os_string(hg_path)?).to_path_buf()) |
|
505 | 507 | } |
|
506 | 508 | |
|
509 | /// Create a new [`HgPathBuf`] from types referenceable as [`OsStr`]. | |
|
507 | 510 | pub fn os_string_to_hg_path_buf<S: AsRef<OsStr>>( |
|
508 | 511 | os_string: S, |
|
509 | 512 | ) -> Result<HgPathBuf, HgPathError> { |
@@ -520,6 +523,7 pub fn os_string_to_hg_path_buf<S: AsRef | |||
|
520 | 523 | Ok(buf) |
|
521 | 524 | } |
|
522 | 525 | |
|
526 | /// Create a new [`HgPathBuf`] from types referenceable as [`Path`]. | |
|
523 | 527 | pub fn path_to_hg_path_buf<P: AsRef<Path>>( |
|
524 | 528 | path: P, |
|
525 | 529 | ) -> Result<HgPathBuf, HgPathError> { |
General Comments 0
You need to be logged in to leave comments.
Login now