Skip to content

Commit 06fdfd6

Browse files
ref(sourcemaps): Fix unnecessary_wraps lint for SourceMapsProcessor::add (#2367)
Ref #2357
1 parent fedf20e commit 06fdfd6

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

src/commands/react_native/appcenter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
171171
ext == OsStr::new("bundle");
172172
then {
173173
let url = format!("~/{filename}");
174-
processor.add(&url, ReleaseFileSearch::collect_file(entry.path())?)?;
174+
processor.add(&url, ReleaseFileSearch::collect_file(entry.path())?);
175175
}
176176
}
177177
}

src/commands/react_native/gradle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
9595
processor.add(
9696
&bundle_url,
9797
ReleaseFileSearch::collect_file(bundle_path.clone())?,
98-
)?;
98+
);
9999
processor.add(
100100
&sourcemap_url,
101101
ReleaseFileSearch::collect_file(sourcemap_path)?,
102-
)?;
102+
);
103103

104104
if let Ok(ram_bundle) = RamBundle::parse_unbundle_from_path(&bundle_path) {
105105
debug!("File RAM bundle found, extracting its contents...");

src/commands/react_native/xcode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
323323
info!(" sourcemap path: {}", sourcemap_path.display());
324324

325325
let mut processor = SourceMapProcessor::new();
326-
processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?)?;
326+
processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?);
327327
processor.add(
328328
&sourcemap_url,
329329
ReleaseFileSearch::collect_file(sourcemap_path)?,
330-
)?;
330+
);
331331
processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?;
332332
processor.add_sourcemap_references()?;
333333
processor.add_debug_id_references()?;

src/commands/sourcemaps/inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
103103
.collect_files()?;
104104
for source in sources {
105105
let url = path_as_url(&source.path);
106-
processor.add(&url, source)?;
106+
processor.add(&url, source);
107107
}
108108
}
109109

src/commands/sourcemaps/upload.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ fn process_sources_from_bundle(
302302
processor.add(
303303
&bundle_url,
304304
ReleaseFileSearch::collect_file(bundle_path.clone())?,
305-
)?;
305+
);
306306
processor.add(
307307
&sourcemap_url,
308308
ReleaseFileSearch::collect_file(sourcemap_path)?,
309-
)?;
309+
);
310310

311311
if let Ok(ram_bundle) = sourcemap::ram_bundle::RamBundle::parse_unbundle_from_path(&bundle_path)
312312
{
@@ -394,7 +394,7 @@ fn process_sources_from_paths(
394394
for source in sources {
395395
let local_path = source.path.strip_prefix(base_path).unwrap();
396396
let url = format!("{}/{}{}", url_prefix, path_as_url(local_path), url_suffix);
397-
processor.add(&url, source)?;
397+
processor.add(&url, source);
398398
}
399399
}
400400

src/utils/sourcemaps.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ impl SourceMapProcessor {
254254
}
255255

256256
/// Adds a new file for processing.
257-
#[expect(clippy::unnecessary_wraps)]
258-
pub fn add(&mut self, url: &str, file: ReleaseFileMatch) -> Result<()> {
257+
pub fn add(&mut self, url: &str, file: ReleaseFileMatch) {
259258
self.pending_sources.insert((url.to_string(), file));
260-
Ok(())
261259
}
262260

263261
fn flush_pending_sources(&mut self) {

0 commit comments

Comments
 (0)