Skip to content

Commit 15f07af

Browse files
committed
Remove incorrect mount API
Signed-off-by: Alex Saveau <[email protected]>
1 parent 2293963 commit 15f07af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mount/mount_unmount.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ pub fn mount<Source: path::Arg, Target: path::Arg, Fs: path::Arg, Data: path::Ar
1919
target: Target,
2020
file_system_type: Fs,
2121
flags: MountFlags,
22-
data: Data,
22+
data: impl Into<Option<Data>>,
2323
) -> io::Result<()> {
2424
source.into_with_c_str(|source| {
2525
target.into_with_c_str(|target| {
2626
file_system_type.into_with_c_str(|file_system_type| {
27-
data.into_with_c_str(|data| {
27+
option_into_with_c_str(data.into(), |data| {
2828
backend::mount::syscalls::mount(
2929
Some(source),
3030
target,
3131
Some(file_system_type),
3232
MountFlagsArg(flags.bits()),
33-
Some(data),
33+
data,
3434
)
3535
})
3636
})
@@ -49,6 +49,8 @@ pub fn mount<Source: path::Arg, Target: path::Arg, Fs: path::Arg, Data: path::Ar
4949
///
5050
/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
5151
#[inline]
52+
#[deprecated(note = "This API was added in error, use the expressive mount APIs instead.")]
53+
#[doc(hidden)]
5254
pub fn mount2<Source: path::Arg, Target: path::Arg, Fs: path::Arg>(
5355
source: Option<Source>,
5456
target: Target,

0 commit comments

Comments
 (0)