Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mut from build_source_map_from #6276

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/swc/src/lib.rs
Expand Up @@ -498,7 +498,7 @@ impl Compiler {

self.cm
.build_source_map_with_config(
&mut src_map_buf,
&src_map_buf,
orig,
SwcSourceMapConfig {
source_file_name,
Expand All @@ -523,7 +523,7 @@ impl Compiler {

self.cm
.build_source_map_with_config(
&mut src_map_buf,
&src_map_buf,
orig,
SwcSourceMapConfig {
source_file_name,
Expand Down
6 changes: 3 additions & 3 deletions crates/swc_common/src/source_map.rs
Expand Up @@ -1115,7 +1115,7 @@ impl SourceMap {
///
#[cfg(feature = "sourcemap")]
#[cfg_attr(docsrs, doc(cfg(feature = "sourcemap")))]
pub fn build_source_map(&self, mappings: &mut Vec<(BytePos, LineCol)>) -> sourcemap::SourceMap {
pub fn build_source_map(&self, mappings: &[(BytePos, LineCol)]) -> sourcemap::SourceMap {
self.build_source_map_from(mappings, None)
}

Expand All @@ -1124,7 +1124,7 @@ impl SourceMap {
#[cfg_attr(docsrs, doc(cfg(feature = "sourcemap")))]
pub fn build_source_map_from(
&self,
mappings: &mut Vec<(BytePos, LineCol)>,
mappings: &[(BytePos, LineCol)],
orig: Option<&sourcemap::SourceMap>,
) -> sourcemap::SourceMap {
self.build_source_map_with_config(mappings, orig, DefaultSourceMapGenConfig)
Expand All @@ -1135,7 +1135,7 @@ impl SourceMap {
#[cfg_attr(docsrs, doc(cfg(feature = "sourcemap")))]
pub fn build_source_map_with_config(
&self,
mappings: &mut Vec<(BytePos, LineCol)>,
mappings: &[(BytePos, LineCol)],
orig: Option<&sourcemap::SourceMap>,
config: impl SourceMapGenConfig,
) -> sourcemap::SourceMap {
Expand Down