chore: Use once_cell instead of lazy_static (#178)

This commit is contained in:
Dmitry Dygalo
2022-09-13 16:06:21 +02:00
committed by GitHub
parent 5f77b420cd
commit 08152787e1
3 changed files with 5 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use std::collections::BTreeSet;
lazy_static! {
static ref ANNOTATED_SUBSCRIPTS: BTreeSet<&'static str> = BTreeSet::from([
static ANNOTATED_SUBSCRIPTS: Lazy<BTreeSet<&'static str>> = Lazy::new(|| {
BTreeSet::from([
"AbstractAsyncContextManager",
"AbstractContextManager",
"AbstractSet",
@@ -80,8 +80,8 @@ lazy_static! {
"set",
"tuple",
"type",
]);
}
])
});
pub fn is_annotated_subscript(name: &str) -> bool {
ANNOTATED_SUBSCRIPTS.contains(name)