Fix basic routers

This commit is contained in:
Evan Almloff committed 2024-01-16 14:39:48 -06:00
1 parent 918d09b516
commit b58eb04278
6 files changed
+22 -31

No files matched your search

+1 -4
View File
@@ -27,10 +27,7 @@ pub fn try_consume_context<T: 'static + Clone>() -> Option<T> {
pub fn consume_context<T: 'static + Clone>() -> T {
with_current_scope(|cx| cx.consume_context::<T>())
.flatten()
.expect(&format!(
"Could not find context {}",
std::any::type_name::<T>(),
))
.unwrap_or_else(|| panic!("Could not find context {}", std::any::type_name::<T>()))
}
/// Consume context from the current scope