From 530fbf2464356469e678551c5033685faa8d280a Mon Sep 17 00:00:00 2001 From: tummychow Date: Sun, 11 Mar 2018 01:14:58 -0800 Subject: remove superfluous deref this is a very cute trick, but also one that's easy to cargo cult incorrectly. only one deref is needed here (derefing from Rc>> to Vec>) and then a reference can be taken (&Vec>) which provides the desired into_iter. the second deref goes from Vec> to &[Vec] which is unnecessary since Vec already has an iterator over references. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2446e34..9a332ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -191,7 +191,7 @@ fn apply_hunk_to_tree<'repo>( post }; // next, write the added side of the hunk - for line in &**hunk.added.lines { + for line in &*hunk.added.lines { blobwriter.write_all(line)?; } // if this hunk removed lines from the old content, those must be -- cgit v1.2.3