ruff: Fix PLW0108 Lambda may be unnecessary.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-02-29 17:56:37 -08:00
committed by Tim Abbott
parent 553f268b04
commit d748ec8d52
11 changed files with 17 additions and 19 deletions

View File

@@ -42,8 +42,8 @@ class StateHandler:
def __init__(self, user_profile: UserProfile) -> None:
self.user_profile = user_profile
self.marshal: Callable[[object], str] = lambda obj: json.dumps(obj)
self.demarshal: Callable[[str], object] = lambda obj: json.loads(obj)
self.marshal: Callable[[object], str] = json.dumps
self.demarshal: Callable[[str], object] = json.loads
def get(self, key: str) -> object:
return self.demarshal(get_bot_storage(self.user_profile, key))