26 lines · 615 B · Rust
RawDownload
use std::collections::{BTreeSet, HashSet}; use gix_refspec::{RefSpec, parse::Operation}; fn pair() -> Vec<RefSpec> {    let lhs = gix_refspec::parse("refs/heads/foo".into(), Operation::Push).unwrap();    let rhs = gix_refspec::parse("refs/heads/foo:refs/heads/foo".into(), Operation::Push).unwrap();    vec![lhs.to_owned(), rhs.to_owned()]} #[test]fn cmp() {    assert_eq!(BTreeSet::from_iter(pair()).len(), 1);} #[test]fn hash() {    let set: HashSet<_> = pair().into_iter().collect();    assert_eq!(set.len(), 1);} #[test]fn eq() {    let specs = pair();    assert_eq!(&specs[0], &specs[1]);}

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