Skip to content

Commit db3f6cb

Browse files
Copilotcgwalters
andauthored
Address code review feedback: rename variable, improve test error messages
Co-authored-by: cgwalters <244096+cgwalters@users.noreply.github.com> Agent-Logs-Url: https://github.com/bootc-dev/bootc/sessions/ce7bf603-8a51-4bd9-8653-6e1221a2bdc6
1 parent e069f7c commit db3f6cb

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

crates/lib/src/loader_entries.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ fn compute_merged_options(
135135
target_source: &str,
136136
new_options: Option<&str>,
137137
) -> Result<CmdlineOwned> {
138-
let mut merged = Cmdline::from(current_options);
138+
let mut result = Cmdline::from(current_options);
139139

140140
// Remove old options from the target source (if it was previously tracked)
141141
if let Some(old_source_opts) = source_options.get(target_source) {
142142
for param in old_source_opts.iter() {
143-
merged.remove_exact(&param);
143+
result.remove_exact(&param);
144144
}
145145
}
146146

@@ -149,12 +149,12 @@ fn compute_merged_options(
149149
if !new_opts.is_empty() {
150150
let new_cmdline = Cmdline::from(new_opts);
151151
for param in new_cmdline.iter() {
152-
merged.add(&param);
152+
result.add(&param);
153153
}
154154
}
155155
}
156156

157-
Ok(merged)
157+
Ok(result)
158158
}
159159

160160
#[cfg(test)]
@@ -263,7 +263,9 @@ mod tests {
263263
#[test]
264264
fn test_set_options_for_source_in_entry() {
265265
let td = tempfile::tempdir().unwrap();
266-
let entry_path = Utf8Path::from_path(td.path()).unwrap().join("test.conf");
266+
let entry_path = Utf8Path::from_path(td.path())
267+
.expect("temp path should be valid UTF-8")
268+
.join("test.conf");
267269

268270
let initial_content = "\
269271
title Test OS

0 commit comments

Comments
 (0)