summaryrefslogtreecommitdiffstats
path: root/src/repository/repository.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-06-20 18:53:44 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-08-18 10:07:17 +0200
commit42f0f7428fd1e956496a4892e6b3983310e0944d (patch)
tree3bd6fe95b26f9d90d6c011d4d26400e1835f0673 /src/repository/repository.rs
parent4b1f0d251a542ad1f02c7b17005ff18ea893d78f (diff)
Fix indentation
The last few refactorings did not fix the indentation (on purpose), so that the actual diff of the refactoring is more visible. This commit now cleans up on that by fixing _only_ the indentation. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/repository/repository.rs')
-rw-r--r--src/repository/repository.rs52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/repository/repository.rs b/src/repository/repository.rs
index 45c4604..7b7b046 100644
--- a/src/repository/repository.rs
+++ b/src/repository/repository.rs
@@ -140,33 +140,33 @@ impl Repository {
config::ConfigError::NotFound(_) => Ok(Vec::with_capacity(0)),
other => Err(other),
})?
- .into_iter()
-
- // Map all `Value`s to String and then join them on the path that is relative to
- // the root directory of the repository.
- .map(config::Value::into_str)
- .map_err(Error::from)
- .map_ok(|patch| path_relative_to_root.join(patch))
- .inspect(|patch| trace!("Patch relative to root: {:?}", patch.as_ref().map(|p| p.display())))
+ .into_iter()
- // if the patch file exists, use it (as config::Value).
- //
- // Otherwise we have an error here, because we're refering to a non-existing file.
- .and_then_ok(|patch| if patch.exists() {
- trace!("Path to patch exists: {}", patch.display());
- Ok(Some(patch))
- } else if patches_before_merge.iter().any(|pb| pb.file_name() == patch.file_name()) {
- // We have a patch already in the array that is named equal to the patch
- // we have in the current recursion.
- // It seems like this patch was already in the list and we re-found it
- // because we loaded a deeper pkg.toml file.
- Ok(None)
- } else {
- trace!("Path to patch does not exist: {}", patch.display());
- Err(anyhow!("Patch does not exist: {}", patch.display()))
- })
- .filter_map_ok(|o| o)
- .collect::<Result<Vec<_>>>()?;
+ // Map all `Value`s to String and then join them on the path that is relative to
+ // the root directory of the repository.
+ .map(config::Value::into_str)
+ .map_err(Error::from)
+ .map_ok(|patch| path_relative_to_root.join(patch))
+ .inspect(|patch| trace!("Patch relative to root: {:?}", patch.as_ref().map(|p| p.display())))
+
+ // if the patch file exists, use it (as config::Value).
+ //
+ // Otherwise we have an error here, because we're refering to a non-existing file.
+ .and_then_ok(|patch| if patch.exists() {
+ trace!("Path to patch exists: {}", patch.display());
+ Ok(Some(patch))
+ } else if patches_before_merge.iter().any(|pb| pb.file_name() == patch.file_name()) {
+ // We have a patch already in the array that is named equal to the patch
+ // we have in the current recursion.
+ // It seems like this patch was already in the list and we re-found it
+ // because we loaded a deeper pkg.toml file.
+ Ok(None)
+ } else {
+ trace!("Path to patch does not exist: {}", patch.display());
+ Err(anyhow!("Patch does not exist: {}", patch.display()))
+ })
+ .filter_map_ok(|o| o)
+ .collect::<Result<Vec<_>>>()?;
// If we found any patches, use them. Otherwise use the array from before the merge
// (which already has the correct pathes from the previous recursion).