mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-16 00:00:18 +02:00
Use separate lexical scope for lock guard in docs (#2439)
This commit is contained in:
@@ -321,8 +321,10 @@ use std::{
|
||||
/// }
|
||||
///
|
||||
/// async fn handler(State(state): State<AppState>) {
|
||||
/// let mut data = state.data.lock().expect("mutex was poisoned");
|
||||
/// *data = "updated foo".to_owned();
|
||||
/// {
|
||||
/// let mut data = state.data.lock().expect("mutex was poisoned");
|
||||
/// *data = "updated foo".to_owned();
|
||||
/// }
|
||||
///
|
||||
/// // ...
|
||||
/// }
|
||||
|
||||
Reference in New Issue
Block a user