Skip to content

Commit e84bb55

Browse files
committed
TestApp: Extract upstream_index() method
1 parent c23f5e7 commit e84bb55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tests/util/test_app.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ impl TestApp {
127127
}
128128
}
129129

130+
/// Obtain a reference to the upstream repository ("the index")
131+
pub fn upstream_index(&self) -> &UpstreamIndex {
132+
assert_some!(self.0.index.as_ref())
133+
}
134+
130135
/// Obtain a reference to the upstream repository ("the index")
131136
pub fn upstream_repository(&self) -> &git2::Repository {
132-
let index = self.0.index.as_ref().unwrap();
133-
&index.repository
137+
&self.upstream_index().repository
134138
}
135139

136140
/// Obtain a list of crates from the index HEAD

0 commit comments

Comments
 (0)