Mercurial > hg
comparison rust/hg-cpython/src/dirstate/non_normal_entries.rs @ 44973:26114bd6ec60
rust: do a clippy pass
This is the result of running `cargo clippy` on hg-core/hg-cpython and fixing
the lints that do not require too much code churn (and would warrant a separate
commit/complete refactor) and only come from our code (a lot of warnings in
hg-cpython come from `rust-cpython`).
Most of those were good lints, two of them was the linter not being smart
enough (or compiler to get up to `clippy`'s level depending on how you see it).
Maybe in the future we could have `clippy` be part of the CI.
Differential Revision: https://phab.mercurial-scm.org/D8635
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 15 Jun 2020 18:26:40 +0200 |
parents | 8ac5726d695d |
children | e061a1df32a8 |
comparison
equal
deleted
inserted
replaced
44962:ef8dcee272ac | 44973:26114bd6ec60 |
---|---|
60 | 60 |
61 fn translate_key( | 61 fn translate_key( |
62 py: Python, | 62 py: Python, |
63 key: &HgPathBuf, | 63 key: &HgPathBuf, |
64 ) -> PyResult<Option<PyBytes>> { | 64 ) -> PyResult<Option<PyBytes>> { |
65 Ok(Some(PyBytes::new(py, key.as_ref()))) | 65 Ok(Some(PyBytes::new(py, key.as_bytes()))) |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 type NonNormalEntriesIter<'a> = hash_set::Iter<'a, HgPathBuf>; | 69 type NonNormalEntriesIter<'a> = hash_set::Iter<'a, HgPathBuf>; |
70 | 70 |