瀏覽代碼

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());
     }
 }