chore: fmt

This commit is contained in:
Lucas Nogueira
2026-09-26 15:57:33 -03:00
parent a433ec09d1
commit f460570b44
13 changed files with 101 additions and 93 deletions
+2 -6
View File
@@ -42,9 +42,7 @@ impl<R: Runtime> Fs<R> {
match path.into() {
FilePath::Url(u) => self
.resolve_content_uri(u.to_string(), opts.android_mode())
.map_err(|e| {
std::io::Error::other(format!("failed to open file: {e}"))
}),
.map_err(|e| std::io::Error::other(format!("failed to open file: {e}"))),
FilePath::Path(p) => {
// tauri::utils::platform::resources_dir() returns a PathBuf with the Android asset URI prefix
// we must resolve that file with the Android API
@@ -52,9 +50,7 @@ impl<R: Runtime> Fs<R> {
.is_ok()
{
self.resolve_content_uri(p.to_string_lossy(), opts.android_mode())
.map_err(|e| {
std::io::Error::other(format!("failed to open file: {e}"))
})
.map_err(|e| std::io::Error::other(format!("failed to open file: {e}")))
} else {
std::fs::OpenOptions::from(opts).open(p)
}
+8 -6
View File
@@ -191,9 +191,10 @@ impl FromStr for FilePath {
type Err = Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
if let Ok(url) = url::Url::from_str(s)
&& url.scheme().len() != 1 {
return Ok(Self::Url(url));
}
&& url.scheme().len() != 1
{
return Ok(Self::Url(url));
}
Ok(Self::Path(PathBuf::from(s)))
}
}
@@ -202,9 +203,10 @@ impl FromStr for SafeFilePath {
type Err = Error;
fn from_str(s: &str) -> Result<Self> {
if let Ok(url) = url::Url::from_str(s)
&& url.scheme().len() != 1 {
return Ok(Self::Url(url));
}
&& url.scheme().len() != 1
{
return Ok(Self::Url(url));
}
SafePathBuf::new(s.into())
.map(SafeFilePath::Path)