Skip to content

Commit

Permalink
Add converting constructor for TOMLCache
Browse files Browse the repository at this point in the history
This is another backwards compatibility concession to Pkg, which we'll
remove in the breaking follow-up PR.
  • Loading branch information
topolarity committed Jul 3, 2024
1 parent b4aee43 commit 842f332
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ struct TOMLCache{Dates}
p::TOML.Parser{Dates}
d::Dict{String, CachedTOMLDict}
end
const TOML_CACHE = TOMLCache(TOML.Parser{nothing}(), Dict{String, CachedTOMLDict}())
TOMLCache(p::TOML.Parser) = TOMLCache(p, Dict{String, CachedTOMLDict}())
# TODO: Delete this converting constructor once Pkg stops using it
TOMLCache(p::TOML.Parser, d::Dict{String, Dict{String, Any}}) = TOMLCache(p, convert(Dict{String, CachedTOMLDict}, d))

const TOML_CACHE = TOMLCache(TOML.Parser{nothing}())

parsed_toml(project_file::AbstractString) = parsed_toml(project_file, TOML_CACHE, require_lock)
function parsed_toml(project_file::AbstractString, toml_cache::TOMLCache, toml_lock::ReentrantLock)
Expand Down

0 comments on commit 842f332

Please sign in to comment.