##// END OF EJS Templates
rust: fix clippy lints...
Raphaël Gomès -
r53188:f90796d3 default
parent child Browse files
Show More
@@ -206,11 +206,10 impl<G: Graph> MissingAncestors<G> {
206 new_bases
206 new_bases
207 .into_iter()
207 .into_iter()
208 .filter(|&rev| rev != NULL_REVISION)
208 .filter(|&rev| rev != NULL_REVISION)
209 .map(|r| {
209 .inspect(|&r| {
210 if r > max_base {
210 if r > max_base {
211 max_base = r;
211 max_base = r;
212 }
212 }
213 r
214 }),
213 }),
215 );
214 );
216 self.max_base = max_base;
215 self.max_base = max_base;
@@ -217,7 +217,7 pub struct FilelogRevisionData(Vec<u8>);
217 impl FilelogRevisionData {
217 impl FilelogRevisionData {
218 /// Split into metadata and data
218 /// Split into metadata and data
219 pub fn split(&self) -> Result<(Option<&[u8]>, &[u8]), HgError> {
219 pub fn split(&self) -> Result<(Option<&[u8]>, &[u8]), HgError> {
220 const DELIMITER: &[u8; 2] = &[b'\x01', b'\n'];
220 const DELIMITER: &[u8; 2] = b"\x01\n";
221
221
222 if let Some(rest) = self.0.drop_prefix(DELIMITER) {
222 if let Some(rest) = self.0.drop_prefix(DELIMITER) {
223 if let Some((metadata, data)) = rest.split_2_by_slice(DELIMITER) {
223 if let Some((metadata, data)) = rest.split_2_by_slice(DELIMITER) {
@@ -802,9 +802,8 impl InnerRevlog {
802 return Ok(func());
802 return Ok(func());
803 }
803 }
804 self.enter_writing_context(data_end, transaction)
804 self.enter_writing_context(data_end, transaction)
805 .map_err(|e| {
805 .inspect_err(|_| {
806 self.exit_writing_context();
806 self.exit_writing_context();
807 e
808 })?;
807 })?;
809 let res = func();
808 let res = func();
810 self.exit_writing_context();
809 self.exit_writing_context();
@@ -31,10 +31,10
31 ///
31 ///
32 /// * `$name` is the identifier to give to the resulting Rust struct.
32 /// * `$name` is the identifier to give to the resulting Rust struct.
33 /// * `$leaked` corresponds to `UnsafePyLeaked` in the matching `@shared data`
33 /// * `$leaked` corresponds to `UnsafePyLeaked` in the matching `@shared data`
34 /// declaration.
34 /// declaration.
35 /// * `$iterator_type` is the type of the Rust iterator.
35 /// * `$iterator_type` is the type of the Rust iterator.
36 /// * `$success_func` is a function for processing the Rust `(key, value)`
36 /// * `$success_func` is a function for processing the Rust `(key, value)`
37 /// tuple on iteration success, turning it into something Python understands.
37 /// tuple on iteration success, turning it into something Python understands.
38 /// * `$success_func` is the return type of `$success_func`
38 /// * `$success_func` is the return type of `$success_func`
39 ///
39 ///
40 /// # Safety
40 /// # Safety
General Comments 0
You need to be logged in to leave comments. Login now