Skip to content

Commit

Permalink
#563 Fix imutable pattern in EmitterSettings.SkipAnchorName
Browse files Browse the repository at this point in the history
+semver:fix
  • Loading branch information
aaubry committed Apr 1, 2021
2 parents 6911240 + 8c29294 commit d8c5997
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions YamlDotNet/Core/EmitterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public EmitterSettings WithBestIndent(int bestIndent)
bestIndent,
BestWidth,
IsCanonical,
MaxSimpleKeyLength
MaxSimpleKeyLength,
SkipAnchorName
);
}

Expand All @@ -105,7 +106,8 @@ public EmitterSettings WithBestWidth(int bestWidth)
BestIndent,
bestWidth,
IsCanonical,
MaxSimpleKeyLength
MaxSimpleKeyLength,
SkipAnchorName
);
}

Expand All @@ -115,7 +117,8 @@ public EmitterSettings WithMaxSimpleKeyLength(int maxSimpleKeyLength)
BestIndent,
BestWidth,
IsCanonical,
maxSimpleKeyLength
maxSimpleKeyLength,
SkipAnchorName
);
}

Expand All @@ -125,14 +128,20 @@ public EmitterSettings Canonical()
BestIndent,
BestWidth,
true,
MaxSimpleKeyLength
MaxSimpleKeyLength,
SkipAnchorName
);
}

public EmitterSettings WithoutAnchorName()
{
SkipAnchorName = true;
return this;
return new EmitterSettings(
BestIndent,
BestWidth,
IsCanonical,
MaxSimpleKeyLength,
true
);
}

public EmitterSettings WithIndentedSequences()
Expand Down

0 comments on commit d8c5997

Please sign in to comment.