-pub fn disable(source_name: String) -> Result<()> {
- println!("Disabling {}", source_name);
- Ok(())
+pub fn disable(source_name: &String) -> Result<()> {
+ let sources = available_sources();
+ for source in sources {
+ if &source.name() == source_name {
+ return source.disable()
+ }
+ }
+ Err(Error::new(Other, "No such source was available."))