Skip to content

Commit

Permalink
Merge pull request #2 from akonradi-signal/patch-1
Browse files Browse the repository at this point in the history
Add Fixture::into_content method
  • Loading branch information
Y-Nak authored Jan 4, 2024
2 parents aebdfb9 + f5499bc commit d8ab09a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dir-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ impl<T> Fixture<T> {
Self { content, path }
}

/// Returns the content of the fixture.
/// Returns a reference to the content of the fixture.
pub fn content(&self) -> &T {
&self.content
}

/// Consumes the fixture and returns the content.
pub const fn into_content(self) -> T {
self.content
}

/// Returns the absolute path of the fixture.
pub const fn path(&self) -> &'static str {
self.path
Expand Down

0 comments on commit d8ab09a

Please sign in to comment.