Explorar el Código

Minor fix: use RefCell::take().

Jing Yang hace 4 años
padre
commit
cdd7d251dd
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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());
     }
 }