1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:08:10 +00:00

Libraries: Use default constructors/destructors in LibMarkdown

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
This commit is contained in:
Lenny Maiorani 2022-03-04 13:21:26 -07:00 committed by Andreas Kling
parent 103ce2f9e9
commit dd08e84664
11 changed files with 24 additions and 16 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -15,7 +16,7 @@ namespace Markdown {
class Block {
public:
virtual ~Block() { }
virtual ~Block() = default;
virtual String render_to_html(bool tight = false) const = 0;
virtual String render_for_terminal(size_t view_width = 0) const = 0;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -18,7 +19,7 @@ public:
: m_contents(move(contents))
{
}
virtual ~BlockQuote() override { }
virtual ~BlockQuote() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -21,7 +22,7 @@ public:
, m_style(style)
{
}
virtual ~CodeBlock() override { }
virtual ~CodeBlock() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -19,7 +20,7 @@ public:
: m_comment(comment)
{
}
virtual ~CommentBlock() override { }
virtual ~CommentBlock() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -23,7 +24,7 @@ public:
{
}
virtual ~ContainerBlock() override { }
virtual ~ContainerBlock() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -23,7 +24,7 @@ public:
{
VERIFY(m_level > 0);
}
virtual ~Heading() override { }
virtual ~Heading() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -16,10 +17,8 @@ namespace Markdown {
class HorizontalRule final : public Block {
public:
HorizontalRule()
{
}
virtual ~HorizontalRule() override { }
HorizontalRule() = default;
virtual ~HorizontalRule() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -22,7 +23,7 @@ public:
, m_start_number(start_number)
{
}
virtual ~List() override { }
virtual ~List() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -20,7 +21,7 @@ public:
{
}
virtual ~Paragraph() override { }
virtual ~Paragraph() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
* Copyright (c) 2020-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -31,8 +31,8 @@ public:
RecursionDecision walk(Visitor&) const;
};
Table() { }
virtual ~Table() override { }
Table() = default;
virtual ~Table() override = default;
virtual String render_to_html(bool tight = false) const override;
virtual String render_for_terminal(size_t view_width = 0) const override;

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -25,7 +26,7 @@ public:
virtual size_t terminal_length() const = 0;
virtual RecursionDecision walk(Visitor&) const = 0;
virtual ~Node() { }
virtual ~Node() = default;
};
class EmphasisNode : public Node {