diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-04 18:16:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-04 18:17:16 +0200 |
commit | 3cb8ae873c3bbda96902e1eb6c1b71c9cc3e504f (patch) | |
tree | 41b8e21aa141c3112fce7f6f9ca660e2893bd51f /Shell/AST.cpp | |
parent | 7a3ab6c517649e9dfdd50085f10492212b0bcb18 (diff) | |
download | serenity-3cb8ae873c3bbda96902e1eb6c1b71c9cc3e504f.zip |
Shell: Use NonnullRefPtr to simplify some things in the parser/AST
Diffstat (limited to 'Shell/AST.cpp')
-rw-r--r-- | Shell/AST.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Shell/AST.cpp b/Shell/AST.cpp index 5943f33663..ac3a6e8352 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -2041,24 +2041,24 @@ Vector<String> TildeValue::resolve_as_list(RefPtr<Shell> shell) return { shell->expand_tilde(builder.to_string()) }; } -Result<RefPtr<Rewiring>, String> CloseRedirection::apply() const +Result<NonnullRefPtr<Rewiring>, String> CloseRedirection::apply() const { - return static_cast<RefPtr<Rewiring>>((adopt(*new Rewiring(fd, fd, Rewiring::Close::ImmediatelyCloseDestination)))); + return adopt(*new Rewiring(fd, fd, Rewiring::Close::ImmediatelyCloseDestination)); } CloseRedirection::~CloseRedirection() { } -Result<RefPtr<Rewiring>, String> PathRedirection::apply() const +Result<NonnullRefPtr<Rewiring>, String> PathRedirection::apply() const { - auto check_fd_and_return = [my_fd = this->fd](int fd, const String& path) -> Result<RefPtr<Rewiring>, String> { + auto check_fd_and_return = [my_fd = this->fd](int fd, const String& path) -> Result<NonnullRefPtr<Rewiring>, String> { if (fd < 0) { String error = strerror(errno); dbg() << "open() failed for '" << path << "' with " << error; return error; } - return static_cast<RefPtr<Rewiring>>((adopt(*new Rewiring(my_fd, fd, Rewiring::Close::Destination)))); + return adopt(*new Rewiring(my_fd, fd, Rewiring::Close::Destination)); }; switch (direction) { case AST::PathRedirection::WriteAppend: |