[gnome-boxes/wip/rishi/rhel: 4/16] wizard-source: Use 'requires' instead of 'assert'
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/rishi/rhel: 4/16] wizard-source: Use 'requires' instead of 'assert'
- Date: Mon, 11 Sep 2017 16:21:22 +0000 (UTC)
commit b96a1738a884458bb0531a38199f0af71dec0b4c
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Aug 23 18:44:26 2017 +0200
wizard-source: Use 'requires' instead of 'assert'
It seems nicer to use 'requires' (and 'ensures') for expressing post
and pre-conditions. It is more readable and doesn't crash hard when an
invariant is violated.
https://bugzilla.gnome.org/show_bug.cgi?id=786689
src/wizard-source.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 70936a4..228720d 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -177,8 +177,8 @@ private class Boxes.WizardSource: Gtk.Stack {
transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; // FIXME: Why this won't work from .ui
file?
}
- public void setup_ui (AppWindow window) {
- assert (window != null);
+ public void setup_ui (AppWindow window)
+ requires (window != null) {
this.window = window;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]