Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ntfs-shell/main.rs')
-rw-r--r--examples/ntfs-shell/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/ntfs-shell/main.rs b/examples/ntfs-shell/main.rs
index 3df1b59..e4b8a22 100644
--- a/examples/ntfs-shell/main.rs
+++ b/examples/ntfs-shell/main.rs
@@ -466,8 +466,10 @@ where
T: Read + Seek,
{
// Extract any specific $DATA stream name from the file.
- let mid = arg.find(':').unwrap_or(arg.len());
- let (file_name, data_stream_name) = arg.split_at(mid);
+ let (file_name, data_stream_name) = match arg.find(':') {
+ Some(mid) => (&arg[..mid], &arg[mid + 1..]),
+ None => (arg, ""),
+ };
// Compose the output file name and try to create it.
// It must not yet exist, as we don't want to accidentally overwrite things.