https://stackoverflow.com/questions/25428920/how-to-get-a-slice-as-an-array-in-rust
Showing the changes to git-object/src (1 of 4 files). Show all
Unified · Split
| @@ -90,10 +90,10 @@ impl Id { · 89 unmodified lines | |||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | impl Deref for Id { | 92 | impl 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 | ||