Skip to content

Commit 98d7b32

Browse files
committed
Use AbstractString instead of String in most methods
1 parent f159431 commit 98d7b32

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Abstract/DynamicLink.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ default library search paths. This method takes the given `soname` and joins
146146
it to the end of every path within the given `RPath`, returning the resultant
147147
path if it exists, returning back the original `soname` if it doesn't.
148148
"""
149-
function find_library(rpath::RPath, soname::String)
149+
function find_library(rpath::RPath, soname::AbstractString)
150150
for path in canonical_rpaths(rpath)
151151
libpath = joinpath(path, soname)
152152
if isfile(libpath)

src/Abstract/ObjectHandle.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Return the absolute path to the given `soname`, using the linker search path
368368
that the given `ObjectHandle` would use at runtime. See the documentation for
369369
`find_library(::RPath, ::String)` for more details.
370370
"""
371-
function find_library(oh::ObjectHandle, soname::String)
371+
function find_library(oh::ObjectHandle, soname::AbstractString)
372372
return find_library(RPath(oh), soname)
373373
end
374374

@@ -392,4 +392,4 @@ function find_libraries(oh::ObjectHandle)
392392
end
393393

394394
return Dict(s => find_library(oh, strip_rpath(s)) for s in sonames)
395-
end
395+
end

src/Abstract/Section.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ end
7474
7575
Return a list of sections that match the given `name`.
7676
"""
77-
function find(sections::Sections, name::String)
77+
function find(sections::Sections, name::AbstractString)
7878
return find(sections, [name])
7979
end
8080

@@ -83,7 +83,7 @@ end
8383
8484
Return a list of sections that match one of the given `names`.
8585
"""
86-
function find(sections::Sections, names::Vector{String})
86+
function find(sections::Sections, names::Vector{S}) where {S <: AbstractString}
8787
return [s for s in sections if section_name(s) in names]
8888
end
8989

@@ -92,7 +92,7 @@ end
9292
9393
Return the first section that matches the given `name`.
9494
"""
95-
function findfirst(sections::Sections, name::String)
95+
function findfirst(sections::Sections, name::AbstractString)
9696
return findfirst(sections, [name])
9797
end
9898

@@ -348,4 +348,4 @@ function show(io::IO, s::Union{Section{H},SectionRef{H}}) where {H <: ObjectHand
348348
end
349349
end
350350

351-
show(io::IO, sects::Sections{H}) where {H <: ObjectHandle} = show_collection(io, sects, H)
351+
show(io::IO, sects::Sections{H}) where {H <: ObjectHandle} = show_collection(io, sects, H)

0 commit comments

Comments
 (0)