mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
[red-knot] Minor improvements to KnownFunction
API (#15441)
A small PR to reduce some of the code duplication between the various branches, make it a little more readable and move the API closer to what we already have for `KnownClass`
This commit is contained in:
parent
c8795fcb37
commit
06b7f4495e
3 changed files with 49 additions and 60 deletions
|
@ -154,6 +154,10 @@ impl KnownModule {
|
|||
}
|
||||
}
|
||||
|
||||
pub const fn is_builtins(self) -> bool {
|
||||
matches!(self, Self::Builtins)
|
||||
}
|
||||
|
||||
pub const fn is_typing(self) -> bool {
|
||||
matches!(self, Self::Typing)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue