Skip to content

Commit

Permalink
refactor(snap): Clarify a runtime's name
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Mar 1, 2024
1 parent 6eb6437 commit 11e6b24
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/snapbox/src/data/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) fn get() -> std::sync::MutexGuard<'static, Runtime> {

#[derive(Default)]
pub(crate) struct Runtime {
per_file: Vec<FileRuntime>,
per_file: Vec<SourceFileRuntime>,
}

impl Runtime {
Expand All @@ -28,7 +28,7 @@ impl Runtime {
{
entry.update(&actual, inline)?;
} else {
let mut entry = FileRuntime::new(inline)?;
let mut entry = SourceFileRuntime::new(inline)?;
entry.update(&actual, inline)?;
self.per_file.push(entry);
}
Expand All @@ -37,18 +37,18 @@ impl Runtime {
}
}

struct FileRuntime {
struct SourceFileRuntime {
path: std::path::PathBuf,
original_text: String,
patchwork: Patchwork,
}

impl FileRuntime {
fn new(inline: &Inline) -> std::io::Result<FileRuntime> {
impl SourceFileRuntime {
fn new(inline: &Inline) -> std::io::Result<SourceFileRuntime> {
let path = inline.position.file.clone();
let original_text = std::fs::read_to_string(&path)?;
let patchwork = Patchwork::new(original_text.clone());
Ok(FileRuntime {
Ok(SourceFileRuntime {
path,
original_text,
patchwork,
Expand Down

0 comments on commit 11e6b24

Please sign in to comment.