Skip to content

Commit

Permalink
Source.code need not be in an Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Nov 11, 2023
1 parent a87bc43 commit 974ea0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct SourceFile {
pub tree_relative_path: Utf8PathBuf,

/// Full copy of the source.
pub code: Arc<String>,
pub code: String,
}

impl SourceFile {
Expand All @@ -46,7 +46,7 @@ impl SourceFile {
.replace("\r\n", "\n");
Ok(SourceFile {
tree_relative_path,
code: Arc::new(code),
code,
package: Arc::clone(package),
})
}
Expand Down Expand Up @@ -85,6 +85,6 @@ mod test {
}),
)
.unwrap();
assert_eq!(*source_file.code, "fn main() {\n 640 << 10;\n}\n");
assert_eq!(source_file.code, "fn main() {\n 640 << 10;\n}\n");
}
}

0 comments on commit 974ea0c

Please sign in to comment.