Skip to content

Commit 3bc4a07

Browse files
authored
Fix MockRepository example in docs (#19)
* Add Default implementation in example * Derive Default for MockRepository in docs Replace the manual implementation with the derive attribute in the rstest fixture example. This keeps the code concise and ensures the example compiles.
1 parent ccba565 commit 3bc4a07

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/rust-testing-with-rstest-fixtures.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ trait Repository {
261261
fn get_item_name(&self, id: &str) -> Option<String>;
262262
}
263263

264+
#[derive(Default)]
264265
struct MockRepository {
265266
data: HashMap<String, String>,
266267
}

0 commit comments

Comments
 (0)