Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/commands/sourcemaps/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ pub fn make_command(command: Command) -> Command {
}

/// Returns the zero indexed position from matches
#[expect(clippy::unnecessary_wraps)]
fn lookup_pos(matches: &ArgMatches) -> Option<(u32, u32)> {
Some((
fn lookup_pos(matches: &ArgMatches) -> (u32, u32) {
(
matches.get_one::<u32>("line").map_or(0, |x| x - 1),
matches.get_one::<u32>("column").map_or(0, |x| x - 1),
))
)
}

fn count_whitespace_prefix(test: &str) -> i32 {
Expand Down Expand Up @@ -154,17 +153,18 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
println!();

// perform a lookup
if let Some((line, column)) = lookup_pos(matches) {
println!(
"Searching for token nearest to line {}, column {} in the minified file:\n",
line + 1,
column + 1
);
if let Some(token) = sm.lookup_token(line, column) {
print_token(&token);
} else {
println!(" - no token found!");
}
let (line, column) = lookup_pos(matches);

println!(
"Searching for token nearest to line {}, column {} in the minified file:\n",
line + 1,
column + 1
);

if let Some(token) = sm.lookup_token(line, column) {
print_token(&token);
} else {
println!(" - no token found!");
}

Ok(())
Expand Down
Loading