Skip to content

Commit 17fadaf

Browse files
committed
Make clippy happy
Signed-off-by: Xuanwo <github@xuanwo.io>
1 parent ad8e632 commit 17fadaf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/common/base/src/base/singleton_instance.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use std::collections::HashMap;
1615
use std::fmt::Debug;
17-
use std::sync::Mutex;
1816

1917
use once_cell::sync::OnceCell;
2018
use state::Container;
@@ -27,7 +25,7 @@ pub enum Singleton {
2725
Production(Container![Send + Sync]),
2826

2927
#[cfg(debug_assertions)]
30-
Testing(Mutex<HashMap<String, Container![Send + Sync]>>),
28+
Testing(std::sync::Mutex<std::collections::HashMap<String, Container![Send + Sync]>>),
3129
}
3230

3331
unsafe impl Send for Singleton {}
@@ -80,6 +78,7 @@ impl Debug for Singleton {
8078
f.debug_struct("Singleton")
8179
.field("type", &match self {
8280
Self::Production(_) => "Production",
81+
#[cfg(debug_assertions)]
8382
Self::Testing(_) => "Testing",
8483
})
8584
.finish()
@@ -105,7 +104,7 @@ impl Global {
105104
/// Should only be initiated once and only used in testing.
106105
#[cfg(debug_assertions)]
107106
pub fn init_testing() {
108-
let _ = GLOBAL.set(Singleton::Testing(Mutex::default()));
107+
let _ = GLOBAL.set(Singleton::Testing(std::sync::Mutex::default()));
109108
}
110109

111110
/// drop testing global data by thread name.

0 commit comments

Comments
 (0)