Sebastian ThielDon't hardcode Sha1 (#413)521c8944 years agoHistory
16 lines · 436 B · Rust
RawDownload
mod from_hex_len {    use git_hash::Kind;     #[test]    fn some_sha1() {        assert_eq!(Kind::from_hex_len(0), Some(Kind::Sha1));        assert_eq!(Kind::from_hex_len(10), Some(Kind::Sha1));        assert_eq!(Kind::from_hex_len(20), Some(Kind::Sha1));        assert_eq!(Kind::from_hex_len(40), Some(Kind::Sha1));    }     #[test]    fn none_if_there_is_no_fit() {        assert_eq!(Kind::from_hex_len(65), None);    }}

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