Преглед изворни кода

Minor fix: use RefCell::take().

Jing Yang пре 4 година
родитељ
комит
cdd7d251dd
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/daemon_env.rs

+ 1 - 1
src/daemon_env.rs

@@ -231,7 +231,7 @@ impl ThreadEnv {
 
     /// Detach the instance stored in the current thread.
     pub fn detach() {
-        Self::ENV.with(|env| env.replace(Default::default()));
+        Self::ENV.with(|env| env.take());
     }
 }