Skip to content

Commit

Permalink
chore: removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
iamwacko committed Feb 16, 2024
1 parent 270333d commit 75c39ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
1 change: 1 addition & 0 deletions synth/src/cli/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ impl Store {
let mut file = std::fs::OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(self.collection_path(ns_path, &collection))?;
serde_json::to_writer_pretty(&mut file, &content)?;
Ok(())
Expand Down
31 changes: 0 additions & 31 deletions synth/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
use std::env;
use std::path::PathBuf;
use std::str::FromStr;

use anyhow::Result;

pub struct DataDirectoryPath(PathBuf);

impl Default for DataDirectoryPath {
fn default() -> Self {
let path = env::current_dir()
.expect("Failed to get current directory. Either the current directory does not exist or the user has insufficient permissions.")
.join(".synth/");
Self(path)
}
}

impl ToString for DataDirectoryPath {
fn to_string(&self) -> String {
self.0.to_str().unwrap().to_string()
}
}

impl FromStr for DataDirectoryPath {
type Err = <PathBuf as FromStr>::Err;

fn from_str(s: &str) -> Result<Self, Self::Err> {
PathBuf::from_str(s).map(Self)
}
}

#[cfg(debug_assertions)]
pub mod splash {
use anyhow::Result;
Expand Down

0 comments on commit 75c39ee

Please sign in to comment.