style: cargo fmt --all

This commit is contained in:
Chris Hennick 2024-05-03 15:18:31 -07:00
parent 74e76a94ca
commit 1b2c42b199
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -220,12 +220,13 @@ pub(crate) fn path_to_string<T: AsRef<Path>>(path: T) -> String {
let mut maybe_original = None; let mut maybe_original = None;
if let Some(original) = path.as_ref().to_str() { if let Some(original) = path.as_ref().to_str() {
if (MAIN_SEPARATOR == '/' || !original[1..].contains(MAIN_SEPARATOR)) if (MAIN_SEPARATOR == '/' || !original[1..].contains(MAIN_SEPARATOR))
&& !original.ends_with('.') && !original.ends_with('.')
&& !original.starts_with(['.', MAIN_SEPARATOR]) && !original.starts_with(['.', MAIN_SEPARATOR])
&& !original.starts_with(['.', '.', MAIN_SEPARATOR]) && !original.starts_with(['.', '.', MAIN_SEPARATOR])
&& !original.contains([MAIN_SEPARATOR, MAIN_SEPARATOR]) && !original.contains([MAIN_SEPARATOR, MAIN_SEPARATOR])
&& !original.contains([MAIN_SEPARATOR, '.', MAIN_SEPARATOR]) && !original.contains([MAIN_SEPARATOR, '.', MAIN_SEPARATOR])
&& !original.contains([MAIN_SEPARATOR, '.', '.', MAIN_SEPARATOR]){ && !original.contains([MAIN_SEPARATOR, '.', '.', MAIN_SEPARATOR])
{
if original.starts_with(MAIN_SEPARATOR) { if original.starts_with(MAIN_SEPARATOR) {
maybe_original = Some(&original[1..]); maybe_original = Some(&original[1..]);
} else { } else {