Skip to content

Commit 4e128f4

Browse files
committed
Fix clippy warnings
1 parent e739fe2 commit 4e128f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/manifest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ Locates a manifest embedded in Rust source.
517517
518518
Returns `Some((manifest, source))` if it finds a manifest, `None` otherwise.
519519
*/
520-
fn find_embedded_manifest(s: &str) -> Option<(Manifest, &str)> {
520+
fn find_embedded_manifest(s: &str) -> Option<(Manifest<'_>, &str)> {
521521
find_short_comment_manifest(s).or_else(|| find_code_block_manifest(s))
522522
}
523523

@@ -729,7 +729,7 @@ fn main() {}
729729
/**
730730
Locates a "short comment manifest" in Rust source.
731731
*/
732-
fn find_short_comment_manifest(s: &str) -> Option<(Manifest, &str)> {
732+
fn find_short_comment_manifest(s: &str) -> Option<(Manifest<'_>, &str)> {
733733
let re: Regex = Regex::new(r"^(?i)\s*//\s*cargo-deps\s*:(.*?)(\r\n|\n)").unwrap();
734734
/*
735735
This is pretty simple: the only valid syntax for this is for the first, non-blank line to contain a single-line comment whose first token is `cargo-deps:`. That's it.
@@ -745,7 +745,7 @@ fn find_short_comment_manifest(s: &str) -> Option<(Manifest, &str)> {
745745
/**
746746
Locates a "code block manifest" in Rust source.
747747
*/
748-
fn find_code_block_manifest(s: &str) -> Option<(Manifest, &str)> {
748+
fn find_code_block_manifest(s: &str) -> Option<(Manifest<'_>, &str)> {
749749
let re_crate_comment: Regex = {
750750
Regex::new(
751751
r"(?x)

src/templates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn expand(src: &str, subs: &HashMap<&str, &str>) -> MainResult<String> {
99
let re_sub = Regex::new(r"#\{([A-Za-z_][A-Za-z0-9_]*)}").unwrap();
1010

1111
// The estimate of final size is the sum of the size of all the input.
12-
let sub_size = subs.iter().map(|(_, v)| v.len()).sum::<usize>();
12+
let sub_size = subs.values().map(|v| v.len()).sum::<usize>();
1313
let est_size = src.len() + sub_size;
1414

1515
let mut anchor = 0;

0 commit comments

Comments
 (0)