Skip to content

Commit

Permalink
Appease the tooling.
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed May 7, 2024
1 parent 61310cd commit 893e403
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions cpp/src/Slice/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,23 +999,23 @@ Slice::Contained::parseFormatMetaData(const list<string>& metaData)
}

bool
Slice::Contained::isDeprecated(bool check_parent) const
Slice::Contained::isDeprecated(bool checkParent) const
{
const string deprecate = "deprecate";
string metadata;
ContainedPtr parent = check_parent ? dynamic_pointer_cast<Contained>(_container) : nullptr;
ContainedPtr parent = checkParent ? dynamic_pointer_cast<Contained>(_container) : nullptr;

return (findMetaData(deprecate, metadata) || parent && parent->findMetaData(deprecate, metadata));
return (findMetaData(deprecate, metadata) || (parent && parent->findMetaData(deprecate, metadata)));
}

optional<string>
Slice::Contained::getDeprecateReason(bool check_parent) const
Slice::Contained::getDeprecateReason(bool checkParent) const
{
const string prefix = "deprecate:";
string metadata;
ContainedPtr parent = check_parent ? dynamic_pointer_cast<Contained>(_container) : nullptr;
ContainedPtr parent = checkParent ? dynamic_pointer_cast<Contained>(_container) : nullptr;

if (findMetaData(prefix, metadata) || parent && parent->findMetaData(prefix, metadata))
if (findMetaData(prefix, metadata) || (parent && parent->findMetaData(prefix, metadata)))
{
assert(metadata.find(prefix) == 0);
return metadata.substr(prefix.size());
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/Slice/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,16 @@ namespace Slice
static FormatType parseFormatMetaData(const std::list<std::string>&);

/// Returns true if this item is deprecated (due to the presence of `deprecate` metadata).
/// @param check_parent If true, this item's immediate container will also be checked for `deprecate` metadata.
/// @param checkParent If true, this item's immediate container will also be checked for `deprecate` metadata.
/// @return True if this item (or possibly its container) has `deprecate` metadata on it, false otherwise.
bool isDeprecated(bool) const;
bool isDeprecated(bool checkParent) const;

/// If this item is deprecated, return its deprecation message (if present).
/// This is the string argument that can be optionally provided with `deprecate` metadata.
/// @param check_parent If true, this item's immediate container will also be checked for `deprecate` messages.
/// @return The message provided to the `deprecate` metadata, if present. If `check_parent` is true, and both
/// @param checkParent If true, this item's immediate container will also be checked for `deprecate` messages.
/// @return The message provided to the `deprecate` metadata, if present. If `checkParent` is true, and both
/// this item and its parent have 'deprecate' messages, the item's message is returned, not its container's.
std::optional<std::string> getDeprecateReason(bool) const;
std::optional<std::string> getDeprecateReason(bool checkParent) const;

enum ContainedType
{
Expand Down
1 change: 0 additions & 1 deletion cpp/src/slice2rb/RubyUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
}
_out << "])";


if ((*s)->isDeprecated(true))
{
// Get the deprecation reason if present, or default to an empty string.
Expand Down

0 comments on commit 893e403

Please sign in to comment.