rust/hg-cpython/src/dirstate.rs
changeset 48022 f2a9db29cb2d
parent 48021 627cd8f33db0
child 48025 631f6b445a77
equal deleted inserted replaced
48021:627cd8f33db0 48022:f2a9db29cb2d
    46 
    46 
    47 pub fn make_dirstate_item(
    47 pub fn make_dirstate_item(
    48     py: Python,
    48     py: Python,
    49     entry: &DirstateEntry,
    49     entry: &DirstateEntry,
    50 ) -> PyResult<PyObject> {
    50 ) -> PyResult<PyObject> {
    51     let &DirstateEntry {
       
    52         state,
       
    53         mode,
       
    54         size,
       
    55         mtime,
       
    56     } = entry;
       
    57     // Explicitly go through u8 first, then cast to platform-specific `c_char`
    51     // Explicitly go through u8 first, then cast to platform-specific `c_char`
    58     // because Into<u8> has a specific implementation while `as c_char` would
    52     // because Into<u8> has a specific implementation while `as c_char` would
    59     // just do a naive enum cast.
    53     // just do a naive enum cast.
    60     let state_code: u8 = state.into();
    54     let state_code: u8 = entry.state().into();
    61     make_dirstate_item_raw(py, state_code, mode, size, mtime)
    55     make_dirstate_item_raw(
       
    56         py,
       
    57         state_code,
       
    58         entry.mode(),
       
    59         entry.size(),
       
    60         entry.mtime(),
       
    61     )
    62 }
    62 }
    63 
    63 
    64 pub fn make_dirstate_item_raw(
    64 pub fn make_dirstate_item_raw(
    65     py: Python,
    65     py: Python,
    66     state: u8,
    66     state: u8,