Skip to content

Commit 9b73532

Browse files
authored
[flake8-async] Fix examples to use async with (#12924)
1 parent d8debb7 commit 9b73532

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::rules::flake8_async::helpers::AsyncModule;
3232
///
3333
///
3434
/// async def main():
35-
/// with asyncio.timeout(2):
35+
/// async with asyncio.timeout(2):
3636
/// await long_running_task()
3737
/// ```
3838
///

crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ use crate::rules::flake8_async::helpers::MethodName;
2222
/// ## Example
2323
/// ```python
2424
/// async def func():
25-
/// with asyncio.timeout(2):
25+
/// async with asyncio.timeout(2):
2626
/// do_something()
2727
/// ```
2828
///
2929
/// Use instead:
3030
/// ```python
3131
/// async def func():
32-
/// with asyncio.timeout(2):
32+
/// async with asyncio.timeout(2):
3333
/// do_something()
3434
/// await awaitable()
3535
/// ```

0 commit comments

Comments
 (0)