refactor: removed unnecessary check for empty vector in DownloadCache load

This commit is contained in:
Ritam Mukherjee 2024-05-22 23:05:10 +05:30
Родитель 23f2247b72
Коммит bc5e7b51a2
1 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -40,15 +40,10 @@ impl DownloadCache {
/// on the persistant storage, else returns a new DownloadCache.
pub fn load(path: PathBuf) -> DownloadCache {
let state = PersistedState::<Vec::<String>>::new(path.join(PERSISTED_STATE_FILE_NAME));
match state.load().is_empty() {
true => DownloadCache {
state: PersistedState::new(path.join(PERSISTED_STATE_FILE_NAME)),
path,
},
false => DownloadCache {
state,
path,
}
state.load();
DownloadCache {
state,
path,
}
}