test.rs 571 B

123456789101112131415
  1. // SPDX-FileCopyrightText: 2021 - 2022 Samuel W. Flint <swflint@flintfam.org>
  2. //
  3. // SPDX-License-Identifier: GPL-3.0-or-later
  4. pub fn rename_repository(config: &mut Config, name: &String, newName: &String) {
  5. let mut repo = config.repositories.get_mut(&name.to_string());
  6. match repo {
  7. Some(repo) => {
  8. repo.name = newName.to_string();
  9. config.repositories.insert(newName.to_string(), repo);
  10. config.repositories.remove(&name.to_string());
  11. },
  12. None => panic!("No known repostory named \"{}\".", name)
  13. }
  14. }