Skip to content

Commit 21c3a03

Browse files
committed
Put source name into filename.
1 parent 98a00b4 commit 21c3a03

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/execution/dumper.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,26 @@ impl<'a> Dumper<'a> {
170170
.map(|s| urlencoding::encode(&s).into_owned())
171171
.join(":");
172172
s.truncate(
173-
(0..FILENAME_PREFIX_MAX_LENGTH)
173+
(0..(FILENAME_PREFIX_MAX_LENGTH - source_op.name.as_str().len()))
174174
.rev()
175175
.find(|i| s.is_char_boundary(*i))
176176
.unwrap_or(0),
177177
);
178178
keys_by_filename_prefix.entry(s).or_default().push(key);
179179
}
180180

181+
let mut file_path_base =
182+
PathBuf::from(&self.options.output_dir).join(source_op.name.as_str());
183+
file_path_base.push(":");
181184
let evaluate_futs =
182185
keys_by_filename_prefix
183186
.into_iter()
184187
.flat_map(|(filename_prefix, keys)| {
185188
let num_keys = keys.len();
189+
let file_path_base = &file_path_base;
186190
keys.into_iter().enumerate().map(move |(i, key)| {
187-
let mut file_path =
188-
Path::new(&self.options.output_dir).join(Path::new(&filename_prefix));
191+
let mut file_path = file_path_base.clone();
192+
file_path.push(&filename_prefix);
189193
if num_keys > 1 {
190194
file_path.push(format!(".{}", i));
191195
}

0 commit comments

Comments
 (0)