|
1 | 1 | use clap::{Parser, Subcommand}; |
2 | 2 | use codeowners::{ |
3 | | - cache::{file::GlobalCache, noop::NoopCache, Cache}, |
| 3 | + cache::{file::GlobalCache, noop::NoopCache, Cache, CacheType}, |
4 | 4 | config::Config, |
5 | 5 | ownership::{FileOwner, Ownership}, |
6 | 6 | project_builder::ProjectBuilder, |
@@ -101,14 +101,15 @@ pub fn cli() -> Result<(), Error> { |
101 | 101 | .attach_printable(format!("Can't open config file: {}", config_path.to_string_lossy()))?; |
102 | 102 |
|
103 | 103 | let config: Config = serde_yaml::from_reader(config_file).change_context(Error::Io)?; |
104 | | - |
105 | | - let cache: &dyn Cache = if args.no_cache { |
106 | | - &NoopCache::default() as &dyn Cache |
| 104 | + let cache: CacheType = if args.no_cache { |
| 105 | + NoopCache::default().into() |
107 | 106 | } else { |
108 | | - &GlobalCache::new(project_root.clone(), config.cache_directory.clone()).change_context(Error::Io)? as &dyn Cache |
| 107 | + GlobalCache::new(project_root.clone(), config.cache_directory.clone()) |
| 108 | + .change_context(Error::Io)? |
| 109 | + .into() |
109 | 110 | }; |
110 | 111 |
|
111 | | - let mut project_builder = ProjectBuilder::new(&config, project_root.clone(), codeowners_file_path.clone(), !args.no_cache, cache); |
| 112 | + let mut project_builder = ProjectBuilder::new(&config, project_root.clone(), codeowners_file_path.clone(), !args.no_cache, &cache); |
112 | 113 | let project = project_builder.build().change_context(Error::Io)?; |
113 | 114 | let ownership = Ownership::build(project); |
114 | 115 |
|
|
0 commit comments