Skip to content

Commit

Permalink
refactor: update RenderIO methods to use instance methods for improve…
Browse files Browse the repository at this point in the history
…d consistency
  • Loading branch information
Kremilly committed Jan 10, 2025
1 parent d09ac00 commit cbc7018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/render/render_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct RenderIO;

impl RenderIO {

fn get_path() -> String {
fn get_path(&self) -> String {
let value = Settings.get("render_markdown.output_path", "STRING");

let value_str = match value {
Expand All @@ -23,8 +23,8 @@ impl RenderIO {
).to_string()
}

pub fn get_file_path(file: &str) -> String {
let path = Self::get_path();
pub fn get_file_path(&self, file: &str) -> String {
let path = self.get_path();

if !FileUtils.check_path_exists(&path) {
let _ = fs::create_dir(&path);
Expand Down
2 changes: 1 addition & 1 deletion src/system/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Markdown {
FileName::new(16, "html").gen()
};

RenderIO::get_file_path(file).replace(".html", &filename)
RenderIO.get_file_path(file).replace(".html", &filename)
}

pub fn append_extras_and_render(markdown: &str) -> String {
Expand Down

0 comments on commit cbc7018

Please sign in to comment.