diff-risk-core 0.1.0

Semantic risk scoring engine for Rust diffs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/utils.rs b/src/utils.rs
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -3,6 +3,6 @@ pub fn greet(name: &str) -> String {
-    let mut s = String::new();
-    s.push_str("Hello, ");
-    s.push_str(name);
-    s
+    let mut buf = String::with_capacity(8 + name.len());
+    buf.push_str("Hello, ");
+    buf.push_str(name);
+    buf
 }