fix fs move issue on lowest directory
This commit is contained in:
@@ -336,13 +336,10 @@ impl FileSystem {
|
|||||||
|
|
||||||
let name = {
|
let name = {
|
||||||
let current_path = path.as_str();
|
let current_path = path.as_str();
|
||||||
if let Some(last_slash_index) = current_path.rfind("/")
|
// This unwrap is safe because an `AbsoluteFilePath` always starts with a slash
|
||||||
&& last_slash_index > 0
|
let last_slash_index = current_path.rfind("/").unwrap();
|
||||||
{
|
|
||||||
¤t_path[last_slash_index + 1..]
|
¤t_path[last_slash_index + 1..]
|
||||||
} else {
|
|
||||||
return Err(io::ErrorKind::AlreadyExists.into());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
target_path =
|
target_path =
|
||||||
|
|||||||
Reference in New Issue
Block a user