diff --git a/compiler/crates/relay-compiler/src/compiler_state.rs b/compiler/crates/relay-compiler/src/compiler_state.rs index bd9311cef49bc..0a35074c3ce40 100644 --- a/compiler/crates/relay-compiler/src/compiler_state.rs +++ b/compiler/crates/relay-compiler/src/compiler_state.rs @@ -207,20 +207,22 @@ impl IncrementalSources { } pub fn get_all_non_empty(&self) -> Vec<(&PathBuf, &V)> { - let mut sources: Vec<_> = - if self.pending.is_empty() { - self.processed - .iter() - .filter(|(_, value)| !value.is_empty()) - .collect() - } else { - self.pending - .iter() - .chain(self.processed.iter().filter(|(key, value)| { - !self.pending.contains_key(*key) && !value.is_empty() - })) - .collect() - }; + let mut sources: Vec<_> = if self.pending.is_empty() { + self.processed + .iter() + .filter(|(_, value)| !value.is_empty()) + .collect() + } else { + self.pending + .iter() + .chain( + self.processed + .iter() + .filter(|(key, _)| !self.pending.contains_key(*key)), + ) + .filter(|(_, value)| !value.is_empty()) + .collect() + }; sources.sort_by_key(|file_content| file_content.0); sources }