Did ever someone notice that git diff
doesn't work very well with Rust's syntax?
Changing
fn foo<T>(x: T)
where
T: Clone,
{
alpha();
beta();
charlie();
}
to
fn foo<T>(x: T)
where
T: Clone,
{
alpha();
beta();
charlie();
delta();
}
and running git diff
, gives:
diff --git a/src/main.rs b/src/main.rs
index 095981f..7434568 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,4 +5,5 @@ where
alpha();
beta();
charlie();
+ delta();
}
Note the @@ where
, which is pretty useless.
When not using the where
syntax, however, git diff
works fine:
diff --git a/src/main.rs b/src/main.rs
index 0ed369a..7f50f46 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,4 +2,5 @@ fn foo<T: Clone>(x: T) {
alpha();
beta();
charlie();
+ delta();
}
Here, the diff output correctly shows the function we're modifying (@@ fn foo…
).