rust/hg-core/src/utils/hg_path.rs
branchstable
changeset 48829 9dcfd1d05e6e
parent 48311 6d69e83e6b6e
child 49749 c7fb9b74e753
equal deleted inserted replaced
48828:ce919b1a1063 48829:9dcfd1d05e6e
   142 /// needed; `HgPath` can be transformed into a platform-specific path (`OsStr`
   142 /// needed; `HgPath` can be transformed into a platform-specific path (`OsStr`
   143 /// or `Path`) whenever more complex operations are needed:
   143 /// or `Path`) whenever more complex operations are needed:
   144 /// On Unix, it's just byte-to-byte conversion. On Windows, it has to be
   144 /// On Unix, it's just byte-to-byte conversion. On Windows, it has to be
   145 /// decoded from MBCS to WTF-8. If WindowsUTF8Plan is implemented, the source
   145 /// decoded from MBCS to WTF-8. If WindowsUTF8Plan is implemented, the source
   146 /// character encoding will be determined on a per-repository basis.
   146 /// character encoding will be determined on a per-repository basis.
   147 //
       
   148 // FIXME: (adapted from a comment in the stdlib)
       
   149 // `HgPath::new()` current implementation relies on `Slice` being
       
   150 // layout-compatible with `[u8]`.
       
   151 // When attribute privacy is implemented, `Slice` should be annotated as
       
   152 // `#[repr(transparent)]`.
       
   153 // Anyway, `Slice` representation and layout are considered implementation
       
   154 // detail, are not documented and must not be relied upon.
       
   155 #[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
   147 #[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
       
   148 #[repr(transparent)]
   156 pub struct HgPath {
   149 pub struct HgPath {
   157     inner: [u8],
   150     inner: [u8],
   158 }
   151 }
   159 
   152 
   160 impl HgPath {
   153 impl HgPath {