Skip to content

Commit

Permalink
Better tuples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hammond authored and Nathan Hammond committed Jul 17, 2023
1 parent ef8459e commit 8074fa7
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions crates/turborepo-lib/src/rewrite_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,20 @@ pub fn set_path(

// Identify the token replacement metadata: start, end, and possible trailing
// join character
let separator;
let start;
let end;

match generate_type {
let (start, end, separator) = match generate_type {
GenerateType::Object => {
separator = "";
start = range.start;
end = range.end;
let start = range.start;
let end = range.end;
let separator = "";
(start, end, separator)
}
GenerateType::Member => {
if property_count > 0 {
separator = ",";
} else {
separator = ""
}

start = range.start + 1;
end = range.start + 1;
let start = range.start + 1;
let end = range.start + 1;
let separator = if property_count > 0 { "," } else { "" };
(start, end, separator)
}
}
};

// Generate the serialized JSON to insert into the document.
// We synthesize objects for missing path segments.
Expand Down

0 comments on commit 8074fa7

Please sign in to comment.