Skip to content

Commit 0d429f7

Browse files
monicatangfacebook-github-bot
authored andcommitted
implement fmt::Display for SchemaChange
Summary: ## Context During the investigation of S380145, it was useful to check whether the compiler build time was regressing due to a full build being triggered. We'd like to log some data on whether a build was incremental or not and if not, why. If we see that we are often falling back to a full builds due to schema changes, we can revisit the classification of schema changes that necessitate a full build. ## This diff As titled - to log the unsafe schema change that requires a full build Reviewed By: tyao1 Differential Revision: D51515403 fbshipit-source-id: 9bdc1d8070fd3b0aff6b930a8fd07c61a1826af8
1 parent 9d10ee3 commit 0d429f7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler/crates/schema-diff/src/definitions.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ pub enum SchemaChange {
171171
DefinitionChanges(Vec<DefinitionChange>),
172172
}
173173

174+
impl fmt::Display for SchemaChange {
175+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
176+
match self {
177+
SchemaChange::None => write!(f, "None"),
178+
SchemaChange::GenericChange => write!(f, "GenericChange"),
179+
SchemaChange::InvalidSchema => write!(f, "InvalidSchema"),
180+
SchemaChange::DefinitionChanges(changes) => write!(f, "{:?}", changes),
181+
}
182+
}
183+
}
184+
174185
impl fmt::Debug for SchemaChange {
175186
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
176187
match self {

0 commit comments

Comments
 (0)