Skip to content

Commit c55fc83

Browse files
test.rs: #[cfg(test)] a function
This is only used from tests and not exported, so conditionalize it.
1 parent 4529f1e commit c55fc83

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

crates/composefs/src/test.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
//! Tests
22
3-
use std::{
4-
ffi::OsString,
5-
fs::{create_dir_all, File},
6-
path::PathBuf,
7-
};
3+
use std::{ffi::OsString, fs::create_dir_all, path::PathBuf};
84

9-
use tempfile::{tempfile_in, TempDir};
5+
use tempfile::TempDir;
106

117
use once_cell::sync::Lazy;
128

@@ -31,7 +27,7 @@ pub fn tempdir() -> TempDir {
3127
TempDir::with_prefix_in("composefs-test-", TMPDIR.as_os_str()).unwrap()
3228
}
3329

34-
/// Allocate a temporary file
35-
pub(crate) fn tempfile() -> File {
36-
tempfile_in(TMPDIR.as_os_str()).unwrap()
30+
#[cfg(test)]
31+
pub(crate) fn tempfile() -> std::fs::File {
32+
tempfile::tempfile_in(TMPDIR.as_os_str()).unwrap()
3733
}

0 commit comments

Comments
 (0)