Skip to content

Commit 2533e2c

Browse files
committed
chore: fmt
1 parent e1a3470 commit 2533e2c

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

runtime/src/ext/virtualfs.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ pub enum VirtualFsError {
5252

5353
struct VirtualFs(Connection);
5454

55+
type NodeInfo = (i64, String, String, i64, i64, i64, i64, i32, Option<String>);
56+
5557
// Dummy file handle for ResourceTable compatibility
5658
#[derive(Debug)]
5759
struct VirtualFileHandle {
@@ -330,13 +332,7 @@ impl VirtualFsExt {
330332
Ok(node_id)
331333
}
332334

333-
fn get_node_info(
334-
conn: &Connection,
335-
path: &str,
336-
) -> Result<
337-
Option<(i64, String, String, i64, i64, i64, i64, i32, Option<String>)>,
338-
VirtualFsError,
339-
> {
335+
fn get_node_info(conn: &Connection, path: &str) -> Result<Option<NodeInfo>, VirtualFsError> {
340336
let path = normalize_path(path);
341337
let mut stmt = conn.prepare_cached(
342338
"SELECT id, node_type, name, size, created_at, modified_at, accessed_at, mode, symlink_target FROM vfs_nodes WHERE path = ?"
@@ -397,7 +393,7 @@ impl VirtualFsExt {
397393
"SELECT content FROM vfs_file_content WHERE node_id = ? ORDER BY chunk_index",
398394
)?;
399395
let chunks: Result<Vec<Vec<u8>>, _> = stmt
400-
.query_map(params![node_id], |row| Ok(row.get::<_, Vec<u8>>(0)?))?
396+
.query_map(params![node_id], |row| row.get::<_, Vec<u8>>(0))?
401397
.collect();
402398

403399
let mut content = Vec::new();
@@ -708,10 +704,11 @@ impl VirtualFsExt {
708704
.and_then(|p| p.to_str())
709705
.map(normalize_path);
710706

711-
if let Some(parent) = &parent_path {
712-
if parent != "/" && Self::get_node_id_by_path(conn, parent)?.is_none() {
713-
return Err(VirtualFsError::PathNotFound(parent.clone()));
714-
}
707+
if let Some(parent) = &parent_path
708+
&& parent != "/"
709+
&& Self::get_node_id_by_path(conn, parent)?.is_none()
710+
{
711+
return Err(VirtualFsError::PathNotFound(parent.clone()));
715712
}
716713

717714
let current_time = current_timestamp();

0 commit comments

Comments
 (0)