Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/action/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl<'a, T> Aggregate<'a, ImplicitSession, T> {
pub fn session(
self,
value: impl Into<&'a mut ClientSession>,
) -> Aggregate<'a, ExplicitSession<'a>> {
) -> Aggregate<'a, ExplicitSession<'a>, T> {
Aggregate {
target: self.target,
pipeline: self.pipeline,
Expand Down Expand Up @@ -265,3 +265,20 @@ impl AggregateTargetRef<'_> {
}
}
}

#[test]
fn aggregate_session_type() {
// Assert that this code compiles but do not actually run it.
#[allow(
unreachable_code,
unused_variables,
dead_code,
clippy::diverging_sub_expression
)]
fn compile_ok() {
let agg: Aggregate = todo!();
let typed: Aggregate<'_, _, ()> = agg.with_type::<()>();
let mut session: ClientSession = todo!();
let typed_session: Aggregate<'_, _, ()> = typed.session(&mut session);
}
}