|
1 | 1 | use glob::glob; |
| 2 | +use serde::Deserialize; |
| 3 | +use serde::Serialize; |
2 | 4 | use std::collections::BTreeMap; |
3 | 5 | use std::fs; |
4 | 6 | use std::io; |
5 | 7 | use std::path::Path; |
6 | 8 | use std::path::PathBuf; |
7 | | -use serde::Deserialize; |
8 | | -use serde::Serialize; |
9 | 9 |
|
10 | 10 | #[allow(unused_imports)] |
11 | 11 | use tracing::{Level, debug, error, info, trace, warn}; |
@@ -120,23 +120,24 @@ pub fn workspace_has_dependencies(workdir: &Path, src: &Path) -> io::Result<bool |
120 | 120 | return Err(io::Error::new(io::ErrorKind::NotFound, msg)); |
121 | 121 | } |
122 | 122 | } else if member_path_from_glob.is_file() |
123 | | - && let Some(filename) = member_path_from_glob.file_name() { |
124 | | - let filename = filename.to_string_lossy(); |
125 | | - if filename == *"Cargo.toml" { |
126 | | - info!(?member_path_from_glob, "🐈 Found a membered path."); |
127 | | - let is_workspace = is_workspace(&member_path_from_glob)?; |
128 | | - if is_workspace { |
129 | | - global_has_deps = global_has_deps |
130 | | - || workspace_has_dependencies( |
131 | | - workdir, |
132 | | - &member_path_from_glob, |
133 | | - )?; |
134 | | - } else { |
135 | | - global_has_deps = global_has_deps |
136 | | - || has_dependencies(&member_path_from_glob)?; |
137 | | - } |
| 123 | + && let Some(filename) = member_path_from_glob.file_name() |
| 124 | + { |
| 125 | + let filename = filename.to_string_lossy(); |
| 126 | + if filename == *"Cargo.toml" { |
| 127 | + info!(?member_path_from_glob, "🐈 Found a membered path."); |
| 128 | + let is_workspace = is_workspace(&member_path_from_glob)?; |
| 129 | + if is_workspace { |
| 130 | + global_has_deps = global_has_deps |
| 131 | + || workspace_has_dependencies( |
| 132 | + workdir, |
| 133 | + &member_path_from_glob, |
| 134 | + )?; |
| 135 | + } else { |
| 136 | + global_has_deps = global_has_deps |
| 137 | + || has_dependencies(&member_path_from_glob)?; |
138 | 138 | } |
139 | 139 | } |
| 140 | + } |
140 | 141 | } |
141 | 142 | } else { |
142 | 143 | warn!("⚠️ Workspace has membered itself at the root of the project."); |
|
0 commit comments