This commit is contained in:
+4
-4
@@ -59,7 +59,7 @@ async fn list_entries(root: &PathBuf) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn check_file_status(root: &PathBuf, filename: Option<String>) -> String {
|
||||
fn check_file_status(root: &Path, filename: Option<String>) -> String {
|
||||
match filename {
|
||||
Some(f) => {
|
||||
let path = root.join("images").join(&f);
|
||||
@@ -73,7 +73,7 @@ fn check_file_status(root: &PathBuf, filename: Option<String>) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
async fn create_entry(root: &PathBuf, title: &str, category: Option<String>) -> Result<()> {
|
||||
async fn create_entry(root: &Path, title: &str, category: Option<String>) -> Result<()> {
|
||||
let slug: String = title
|
||||
.trim()
|
||||
.to_lowercase()
|
||||
@@ -139,7 +139,7 @@ content_file = "{}"
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn remove_entry(root: &PathBuf, name: &str) -> Result<()> {
|
||||
async fn remove_entry(root: &Path, name: &str) -> Result<()> {
|
||||
let toml_path = root.join(format!("{}.toml", name));
|
||||
|
||||
if !toml_path.exists() {
|
||||
@@ -176,7 +176,7 @@ async fn remove_entry(root: &PathBuf, name: &str) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn inspect_entry(root: &PathBuf, name: &str) -> Result<()> {
|
||||
async fn inspect_entry(root: &Path, name: &str) -> Result<()> {
|
||||
let toml_path = root.join(format!("{}.toml", name));
|
||||
if !toml_path.exists() {
|
||||
return Err(anyhow!("Entry '{}' not found", name));
|
||||
|
||||
Reference in New Issue
Block a user