ruff: Fix RUF015 Prefer next(...) over single element slice.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-07-21 15:34:11 -07:00
committed by Tim Abbott
parent 4e645c8ff9
commit 3b09197fdf
21 changed files with 55 additions and 63 deletions

View File

@@ -1542,7 +1542,8 @@ Output:
return values
def find_by_id(self, data: List[Dict[str, Any]], db_id: int) -> Dict[str, Any]:
return [r for r in data if r["id"] == db_id][0]
[r] = (r for r in data if r["id"] == db_id)
return r
def init_default_ldap_database(self) -> None:
"""