File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -165,15 +165,34 @@ impl Diff {
165165 }
166166
167167 pub ( crate ) fn is_empty ( & self ) -> bool {
168- self . config_diffs . is_empty ( )
168+ // Destructure struct to get compiler errors when new fields are added
169+ let & Diff {
170+ ref config_diffs,
171+ ref crate_diffs,
172+ } = self ;
173+
174+ config_diffs. is_empty ( ) && crate_diffs. is_empty ( )
169175 }
170176}
171177
172178impl std:: fmt:: Display for Diff {
173179 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
174- if !& self . config_diffs . is_empty ( ) {
180+ // Destructure struct to get compiler errors when new fields are added
181+ let & Diff {
182+ ref config_diffs,
183+ ref crate_diffs,
184+ } = self ;
185+
186+ if !config_diffs. is_empty ( ) {
175187 writeln ! ( f, "💻 Trusted Publishing Config Diffs:" ) ?;
176- for diff in & self . config_diffs {
188+ for diff in config_diffs {
189+ write ! ( f, "{diff}" ) ?;
190+ }
191+ }
192+
193+ if !crate_diffs. is_empty ( ) {
194+ writeln ! ( f, "💻 Trusted Publishing Crate Diffs:" ) ?;
195+ for diff in crate_diffs {
177196 write ! ( f, "{diff}" ) ?;
178197 }
179198 }
You can’t perform that action at this time.
0 commit comments