Skip to content

Commit

Permalink
Slightly refactor some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Feb 27, 2024
1 parent bf3ab68 commit 5777bcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/channel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ $(TYPEDSIGNATURES)
Check if the channel holds a valid pointer to a `lib.ssh_channel`.
"""
function Base.isassigned(sshchan::SshChannel)
!isnothing(sshchan.ptr)
end
Base.isassigned(sshchan::SshChannel) = !isnothing(sshchan.ptr)

"""
$(TYPEDSIGNATURES)
Expand Down
2 changes: 1 addition & 1 deletion src/session.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ $(TYPEDSIGNATURES)
Check if a session is open.
"""
Base.isopen(session::Session) = !isnothing(session.ptr)
Base.isopen(session::Session) = isassigned(session) # We currently don't allow closed sessions

"""
$(TYPEDSIGNATURES)
Expand Down

0 comments on commit 5777bcc

Please sign in to comment.