Skip to content

Commit 811150c

Browse files
authored
fix a few tiny JET linter issues (JuliaLang#58869)
1 parent 2aed648 commit 811150c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

base/loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ end
184184
const slug_chars = String(['A':'Z'; 'a':'z'; '0':'9'])
185185

186186
function slug(x::UInt32, p::Int)
187-
y::UInt32 = x
188187
sprint(sizehint=p) do io
188+
y = x
189189
n = length(slug_chars)
190190
for i = 1:p
191191
y, d = divrem(y, n)
@@ -1061,6 +1061,7 @@ function explicit_manifest_uuid_path(project_file::String, pkg::PkgId)::Union{No
10611061
for (name, entries) in d
10621062
entries = entries::Vector{Any}
10631063
for entry in entries
1064+
entry = entry::Dict{String, Any}
10641065
uuid = get(entry, "uuid", nothing)::Union{Nothing, String}
10651066
extensions = get(entry, "extensions", nothing)::Union{Nothing, Dict{String, Any}}
10661067
if extensions !== nothing && haskey(extensions, pkg.name) && uuid !== nothing && uuid5(UUID(uuid), pkg.name) == pkg.uuid

base/toml_parser.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ end
258258
mutable struct ParserError <: Exception
259259
type::ErrorType
260260

261-
# Arbitrary data to store at the
261+
# Data to store at the
262262
# call site to be used when formatting
263263
# the error
264-
data
264+
data::Union{Char, Nothing}
265265

266266
# These are filled in before returning from parse function
267267
str ::Union{String, Nothing}
@@ -276,15 +276,15 @@ ParserError(type) = ParserError(type, nothing)
276276
# Defining these below can be useful when debugging code that erroneously returns a
277277
# ParserError because you get a stacktrace to where the ParserError was created
278278
#ParserError(type) = error(type)
279-
#ParserError(type, data) = error(type,data)
279+
#ParserError(type, data) = error(type, data)
280280

281281
# Many functions return either a T or a ParserError
282282
const Err{T} = Union{T, ParserError}
283283

284284
function format_error_message_for_err_type(error::ParserError)
285285
msg = err_message[error.type]
286286
if error.type == ErrInvalidBareKeyCharacter
287-
c_escaped = escape_string(string(error.data)::String)
287+
c_escaped = escape_string(string(error.data::Char))
288288
msg *= ": '$c_escaped'"
289289
end
290290
return msg

0 commit comments

Comments
 (0)