Explorar o código

Minor fix: use RefCell::take().

Jing Yang %!s(int64=4) %!d(string=hai) anos
pai
achega
cdd7d251dd
Modificáronse 1 ficheiros con 1 adicións e 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.
     /// Detach the instance stored in the current thread.
     pub fn detach() {
     pub fn detach() {
-        Self::ENV.with(|env| env.replace(Default::default()));
+        Self::ENV.with(|env| env.take());
     }
     }
 }
 }