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
9090 }
9191
9292 impl Deref for Id {
93− type Target = [u8];
93+ type Target = [u8; 20];
9494
9595 fn deref(&self) -> &Self::Target {
96− &self.0[..]
96+ &self.0
9797 }
9898 }
9999

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t