Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Changing the struct GitBranch to use a default constructor and fields #389

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

StanleyGoldman
Copy link
Contributor

The current constructor for this struct prevents us from creating a default value for the struct itself.

public GitBranch(string name, string tracking, bool active)
{
Guard.ArgumentNotNullOrWhiteSpace(name, "name");
this.name = name;
this.tracking = tracking;
this.active = active;
}

[Serializable]
public struct GitBranch : ITreeData
public struct GitBranch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize you use this interface in #151

@shana
Copy link
Member

shana commented Nov 1, 2017

Just remembered we can do public static GitBranch Default = new GitBranch { }; to leverage the default struct constructor, it should work well enough. Nevermind I'm being dumb we can just use the default constructor

@StanleyGoldman
Copy link
Contributor Author

image

@shana shana force-pushed the fixes/oh-my-struct-constructor branch from ac440d4 to 8718b89 Compare November 2, 2017 00:21
@shana shana force-pushed the fixes/oh-my-struct-constructor branch from 8718b89 to b292c85 Compare November 2, 2017 02:10
@shana shana merged commit d0f33d1 into master Nov 2, 2017
@shana shana deleted the fixes/oh-my-struct-constructor branch November 2, 2017 02:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants