Skip to content

Commit 09c33f0

Browse files
committed
style: remove some unnecessary casts
Signed-off-by: Daniel Biehl <[email protected]>
1 parent 1f18c52 commit 09c33f0

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/jsonrpc2/src/robotcode/jsonrpc2/protocol.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ async def handle_request(self, message: JsonRPCRequest) -> None:
834834
if e.threaded:
835835
if e.is_coroutine:
836836
task = run_coroutine_in_thread(
837-
ensure_coroutine(cast(Callable[..., Any], e.method)),
837+
e.method,
838838
*params[0],
839839
**params[1],
840840
)
@@ -935,9 +935,7 @@ async def handle_notification(self, message: JsonRPCNotification) -> None:
935935
else:
936936
if e.threaded:
937937
if e.is_coroutine:
938-
task = run_coroutine_in_thread(
939-
ensure_coroutine(cast(Callable[..., Any], e.method)), *params[0], **params[1]
940-
)
938+
task = run_coroutine_in_thread(ensure_coroutine(e.method), *params[0], **params[1])
941939
else:
942940
task = asyncio.wrap_future(run_as_task(e.method, *params[0], **params[1]))
943941
else:

packages/plugin/src/robotcode/plugin/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PluginManager:
1414
def instance(cls) -> "Self":
1515
if cls._instance is None:
1616
cls._instance = cls()
17-
return cast("Self", cls._instance)
17+
return cls._instance
1818

1919
def __init__(self) -> None:
2020
self._plugin_manager = pluggy.PluginManager("robotcode")

0 commit comments

Comments
 (0)