Skip to content

Commit e0b3e8a

Browse files
committed
Add panics section
1 parent edfb258 commit e0b3e8a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

rust/rubydex/src/test_utils/graph_test.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ impl GraphTest {
4949
}
5050

5151
/// Returns the normalized source for the given URI.
52+
///
53+
/// # Panics
54+
///
55+
/// Panics if the URI has not been indexed.
5256
#[must_use]
5357
pub fn source(&self, uri: &str) -> &str {
5458
self.sources.get(uri).expect("source not found for URI")
5559
}
5660

5761
/// Returns the source text for a definition, sliced by its offset.
62+
///
63+
/// # Panics
64+
///
65+
/// Panics if the definition or its document does not exist.
5866
#[must_use]
5967
pub fn source_at(&self, definition_id: &DefinitionId) -> &str {
6068
let def = self.graph.definitions().get(definition_id).unwrap();

0 commit comments

Comments
 (0)