History

Use statically known borrowed arrays for perfect type safety!

https://stackoverflow.com/questions/25428920/how-to-get-a-slice-as-an-array-in-rust

Sebastian Thiel committed 6 years ago

Commit 3ead0481 parent 766f3e44 files · +12 −9Browse files

Showing the changes to git-object/src (1 of 4 files). Show all

Unified · Split

git-object/src/types.rs+2−2
@@ -90,10 +90,10 @@ impl Id { · 89 unmodified lines
90}90}
91 91
92impl Deref for Id {92impl Deref for Id {
93 type Target = [u8];93 type Target = [u8; 20];
94 94
95 fn deref(&self) -> &Self::Target {95 fn deref(&self) -> &Self::Target {
96 &self.0[..]96 &self.0
97 }97 }
98}98}
99 99