Skip to content

Commit a28b695

Browse files
committed
fmt
1 parent 21f6bcb commit a28b695

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

raphtory-graphql/src/data.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ use raphtory::{
1717
};
1818
use std::{
1919
collections::HashMap,
20+
ffi::OsStr,
2021
io::{Read, Seek},
2122
path::{Path, PathBuf},
2223
sync::Arc,
2324
};
24-
use std::ffi::OsStr;
2525
use tokio::fs;
2626
use tracing::warn;
2727
use walkdir::WalkDir;
@@ -283,12 +283,16 @@ impl Data {
283283
/// Serializes a graph to disk, overwriting any existing data in its folder.
284284
fn encode_graph_to_disk(graph: GraphWithVectors) -> Result<(), GraphError> {
285285
let folder_path = graph.folder.get_base_path();
286-
let bak_name = "_".to_string() + folder_path.file_name().and_then(|n| n.to_str()).unwrap_or("");
286+
let bak_name = "_".to_string()
287+
+ folder_path
288+
.file_name()
289+
.and_then(|n| n.to_str())
290+
.unwrap_or("");
287291
let bak_path = folder_path.with_file_name(bak_name);
288292

289293
// Write to backup path first
290294
graph.graph.encode(&bak_path)?;
291-
295+
292296
if folder_path.exists() {
293297
// delete old data
294298
std::fs::remove_dir_all(folder_path)?;

raphtory-graphql/src/paths.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ pub(crate) fn valid_path(
128128
if full_path.join(META_PATH).exists() {
129129
if namespace {
130130
return Err(InvalidPathReason::ParentIsGraph(user_facing_path));
131-
} else if component.to_str().ok_or(InvalidPathReason::NonUTFCharacters)?.starts_with("_") {
132-
return Err(InvalidPathReason::GraphNamePrefix)
131+
} else if component
132+
.to_str()
133+
.ok_or(InvalidPathReason::NonUTFCharacters)?
134+
.starts_with("_")
135+
{
136+
return Err(InvalidPathReason::GraphNamePrefix);
133137
}
134138
}
135139
//check for symlinks

0 commit comments

Comments
 (0)