mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Replace lazy_static crate with std::sync::LazyLock
in layout and config (#33065)
* replace in layout_thread_2020 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in layout_thread Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in layout Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in config Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in config_plugins The macro of config_plugins require Send trait bounds Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
c01b733523
commit
016ff5dfa6
12 changed files with 43 additions and 65 deletions
|
@ -195,16 +195,16 @@ impl fmt::Display for PrefError {
|
|||
impl std::error::Error for PrefError {}
|
||||
|
||||
pub struct Accessor<P, V> {
|
||||
pub getter: Box<dyn Fn(&P) -> V + Sync>,
|
||||
pub getter: Box<dyn Fn(&P) -> V + Sync + Send>,
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub setter: Box<dyn Fn(&mut P, V) + Sync>,
|
||||
pub setter: Box<dyn Fn(&mut P, V) + Sync + Send>,
|
||||
}
|
||||
|
||||
impl<P, V> Accessor<P, V> {
|
||||
pub fn new<G, S>(getter: G, setter: S) -> Self
|
||||
where
|
||||
G: Fn(&P) -> V + Sync + 'static,
|
||||
S: Fn(&mut P, V) + Sync + 'static,
|
||||
G: Fn(&P) -> V + Sync + Send + 'static,
|
||||
S: Fn(&mut P, V) + Sync + Send + 'static,
|
||||
{
|
||||
Accessor {
|
||||
getter: Box::new(getter),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue