소스 검색

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