Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/filepatterns.rs @ 49928:ccb6cfb0f2c0
rust-filepatterns: don't `Box` subincludes unnecessarily
This was caught by `clippy`.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 09 Jan 2023 19:07:44 +0100 |
parents | b3480822a251 |
children | e98fd81bb151 |
comparison
equal
deleted
inserted
replaced
49927:2202832b35e8 | 49928:ccb6cfb0f2c0 |
---|---|
579 | 579 |
580 /// Separate and pre-process subincludes from other patterns for the "ignore" | 580 /// Separate and pre-process subincludes from other patterns for the "ignore" |
581 /// phase. | 581 /// phase. |
582 pub fn filter_subincludes( | 582 pub fn filter_subincludes( |
583 ignore_patterns: Vec<IgnorePattern>, | 583 ignore_patterns: Vec<IgnorePattern>, |
584 ) -> Result<(Vec<Box<SubInclude>>, Vec<IgnorePattern>), HgPathError> { | 584 ) -> Result<(Vec<SubInclude>, Vec<IgnorePattern>), HgPathError> { |
585 let mut subincludes = vec![]; | 585 let mut subincludes = vec![]; |
586 let mut others = vec![]; | 586 let mut others = vec![]; |
587 | 587 |
588 for pattern in ignore_patterns { | 588 for pattern in ignore_patterns { |
589 if let PatternSyntax::ExpandedSubInclude(sub_include) = pattern.syntax | 589 if let PatternSyntax::ExpandedSubInclude(sub_include) = pattern.syntax |
590 { | 590 { |
591 subincludes.push(sub_include); | 591 subincludes.push(*sub_include); |
592 } else { | 592 } else { |
593 others.push(pattern) | 593 others.push(pattern) |
594 } | 594 } |
595 } | 595 } |
596 Ok((subincludes, others)) | 596 Ok((subincludes, others)) |