mirror of https://github.com/astral-sh/ruff
chore: Use `once_cell` instead of `lazy_static` (#178)
This commit is contained in:
parent
5f77b420cd
commit
08152787e1
|
|
@ -1759,7 +1759,6 @@ dependencies = [
|
||||||
"filetime",
|
"filetime",
|
||||||
"glob",
|
"glob",
|
||||||
"itertools",
|
"itertools",
|
||||||
"lazy_static",
|
|
||||||
"log",
|
"log",
|
||||||
"notify",
|
"notify",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ fern = { version = "0.6.1" }
|
||||||
filetime = { version = "0.2.17" }
|
filetime = { version = "0.2.17" }
|
||||||
glob = { version = "0.3.0" }
|
glob = { version = "0.3.0" }
|
||||||
itertools = "0.10.3"
|
itertools = "0.10.3"
|
||||||
lazy_static = "1.4.0"
|
|
||||||
log = { version = "0.4.17" }
|
log = { version = "0.4.17" }
|
||||||
notify = { version = "4.0.17" }
|
notify = { version = "4.0.17" }
|
||||||
once_cell = { version = "1.13.1" }
|
once_cell = { version = "1.13.1" }
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use lazy_static::lazy_static;
|
use once_cell::sync::Lazy;
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
lazy_static! {
|
static ANNOTATED_SUBSCRIPTS: Lazy<BTreeSet<&'static str>> = Lazy::new(|| {
|
||||||
static ref ANNOTATED_SUBSCRIPTS: BTreeSet<&'static str> = BTreeSet::from([
|
BTreeSet::from([
|
||||||
"AbstractAsyncContextManager",
|
"AbstractAsyncContextManager",
|
||||||
"AbstractContextManager",
|
"AbstractContextManager",
|
||||||
"AbstractSet",
|
"AbstractSet",
|
||||||
|
|
@ -80,8 +80,8 @@ lazy_static! {
|
||||||
"set",
|
"set",
|
||||||
"tuple",
|
"tuple",
|
||||||
"type",
|
"type",
|
||||||
]);
|
])
|
||||||
}
|
});
|
||||||
|
|
||||||
pub fn is_annotated_subscript(name: &str) -> bool {
|
pub fn is_annotated_subscript(name: &str) -> bool {
|
||||||
ANNOTATED_SUBSCRIPTS.contains(name)
|
ANNOTATED_SUBSCRIPTS.contains(name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue