Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Eastman <[email protected]>
  • Loading branch information
baywet and andrueastman authored Sep 11, 2023
1 parent 907b8b9 commit a14835b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ protected static void RemoveRequestConfigurationClasses(CodeElement currentEleme
}
internal static void AddPrimaryErrorMessage(CodeElement currentElement, string name, Func<CodeType> type, bool asProperty = false)
{
if (currentElement is CodeClass currentClass && currentClass.IsErrorDefinition)
if (currentElement is CodeClass { IsErrorDefinition: true } currentClass)
{
if (asProperty)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Kiota.Builder/Writers/ProprietableBlockExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static string GetPrimaryMessageCodePath<TBlockKind, TBlockDeclaration>(
{
if (block is CodeInterface currentInterface)
{
if (currentInterface.Methods.FirstOrDefault(x => isGetterMethod(x) && x.AccessedProperty is not null && isPrimaryErrorMessage(x.AccessedProperty)) is CodeMethod primaryErrorMessageMethod)
if (currentInterface.Methods.FirstOrDefault(static x => isGetterMethod(x) && x.AccessedProperty is not null && isPrimaryErrorMessage(x.AccessedProperty)) is CodeMethod primaryErrorMessageMethod)
return methodNameNormalization(primaryErrorMessageMethod);
else if (currentInterface.Properties.FirstOrDefault(isPrimaryErrorMessage) is CodeProperty primaryErrorMessageProperty)
return propertyNameNormalization(primaryErrorMessageProperty);
Expand All @@ -34,7 +34,7 @@ internal static string GetPrimaryMessageCodePath<TBlockKind, TBlockDeclaration>(
}
else if (block is CodeClass currentClass)
{
if (currentClass.Methods.FirstOrDefault(x => isGetterMethod(x) && x.AccessedProperty is not null && isPrimaryErrorMessage(x.AccessedProperty)) is CodeMethod primaryErrorMessageMethod)
if (currentClass.Methods.FirstOrDefault(static x => isGetterMethod(x) && x.AccessedProperty is not null && isPrimaryErrorMessage(x.AccessedProperty)) is CodeMethod primaryErrorMessageMethod)
return methodNameNormalization(primaryErrorMessageMethod);
else if (currentClass.Properties.FirstOrDefault(isPrimaryErrorMessage) is CodeProperty primaryErrorMessageProperty)
return propertyNameNormalization(primaryErrorMessageProperty);
Expand Down

0 comments on commit a14835b

Please sign in to comment.