git: clean up remove_remote_git_config_sections

This commit is contained in:
demize 2025-03-10 00:56:32 -04:00
parent cf696ce1b6
commit c3cc3de818

View File

@ -1473,7 +1473,7 @@ fn remove_remote_git_config_sections(
config: &mut gix::config::File, config: &mut gix::config::File,
remote_name: &str, remote_name: &str,
) -> Result<(), GitRemoteManagementError> { ) -> Result<(), GitRemoteManagementError> {
let section_ids_to_remove = config let section_ids_to_remove: Vec<_> = config
.sections_by_name("remote") .sections_by_name("remote")
.into_iter() .into_iter()
.flatten() .flatten()
@ -1488,8 +1488,7 @@ fn remove_remote_git_config_sections(
} }
Ok(section.id()) Ok(section.id())
}) })
.collect::<Result<Vec<_>, _>>()? .try_collect()?;
.into_iter();
for id in section_ids_to_remove { for id in section_ids_to_remove {
config config
.remove_section_by_id(id) .remove_section_by_id(id)