Browse Source

Minor fix: use RefCell::take().

Jing Yang 4 năm trước cách đây
mục cha
commit
cdd7d251dd
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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());
     }
 }