From 9b73532b112b5c2aa9f820bcfc1185d7af6ca02d Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 16 Aug 2024 12:24:59 +0200 Subject: [PATCH] [`flake8-async`] Fix examples to use `async with` (#12924) --- .../rules/flake8_async/rules/async_function_with_timeout.rs | 2 +- .../rules/flake8_async/rules/cancel_scope_no_checkpoint.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs b/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs index 09a01d678cefb..8edb208803315 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs @@ -32,7 +32,7 @@ use crate::rules::flake8_async::helpers::AsyncModule; /// /// /// async def main(): -/// with asyncio.timeout(2): +/// async with asyncio.timeout(2): /// await long_running_task() /// ``` /// diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs b/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs index 6b0b55b014654..408aefca50bc3 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs @@ -22,14 +22,14 @@ use crate::rules::flake8_async::helpers::MethodName; /// ## Example /// ```python /// async def func(): -/// with asyncio.timeout(2): +/// async with asyncio.timeout(2): /// do_something() /// ``` /// /// Use instead: /// ```python /// async def func(): -/// with asyncio.timeout(2): +/// async with asyncio.timeout(2): /// do_something() /// await awaitable() /// ```