We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ff02f0 commit bb332b1Copy full SHA for bb332b1
base/deprecated.jl
@@ -1344,14 +1344,19 @@ end
1344
function replace(s::AbstractString, pat, f, n::Integer)
1345
if n <= 0
1346
depwarn(string("`replace(s, pat, r, count)` with `count <= 0` is deprecated, use ",
1347
- "`replace(s, pat, r, typemax(Int))` or `replace(s, pat, r)` instead"),
+ "`replace(s, pat=>r, count=typemax(Int))` or `replace(s, pat=>r)` instead"),
1348
:replace)
1349
- replace(s, pat, f)
+ replace(s, pat=>f)
1350
else
1351
- replace_new(String(s), pat, f, n)
+ depwarn(string("`replace(s, pat, r, count)` is deprecated, use ",
1352
+ "`replace(s, pat=>r, count=count)`"),
1353
+ :replace)
1354
+ replace(String(s), pat=>f, count=n)
1355
end
1356
1357
1358
+@deprecate replace(s::AbstractString, pat, f) replace(s, pat=>f)
1359
+
1360
# PR #22475
1361
@deprecate ntuple(f, ::Type{Val{N}}) where {N} ntuple(f, Val(N))
1362
@deprecate fill_to_length(t, val, ::Type{Val{N}}) where {N} fill_to_length(t, val, Val(N)) false
base/libgit2/utils.jl
@@ -83,7 +83,7 @@ Standardise the path string `path` to use POSIX separators.
83
"""
84
function posixpath end
85
if Sys.iswindows()
86
- posixpath(path) = replace(path,'\\','/')
+ posixpath(path) = replace(path,'\\' => '/')
87
elseif Sys.isunix()
88
posixpath(path) = path
89
base/markdown/GitHub/table.jl
@@ -11,7 +11,7 @@ function parserow(stream::IO)
11
row = split(line, r"(?<!\\)\|")
12
length(row) == 1 && return
13
isempty(row[1]) && shift!(row)
14
- map!(x -> strip(replace(x, "\\|", "|")), row, row)
+ map!(x -> strip(replace(x, "\\|" => "|")), row, row)
15
isempty(row[end]) && pop!(row)
16
return row
17
@@ -104,7 +104,7 @@ _dash(width, align) =
104
105
function plain(io::IO, md::Table)
106
cells = mapmap(md.rows) do each
107
- replace(plaininline(each), "|", "\\|")
+ replace(plaininline(each), "|" => "\\|")
108
109
padcells!(cells, md.align, len = length, min = 3)
110
for i = axes(cells,1)
base/markdown/render/html.jl
@@ -31,7 +31,7 @@ for ch in "'`!\$%()=+{}[]"
31
32
33
function htmlesc(io::IO, s::AbstractString)
34
- # s1 = replace(s, r"&(?!(\w+|\#\d+);)", "&")
+ # s1 = replace(s, r"&(?!(\w+|\#\d+);)" => "&")
35
for ch in s
36
print(io, get(_htmlescape_chars, ch, ch))
37
base/markdown/render/rst.jl
@@ -124,7 +124,7 @@ end
124
125
rstinline(io::IO, f::Footnote) = print(io, "[", f.id, "]_")
126
127
-rstescape(s) = replace(s, "\\", "\\\\")
+rstescape(s) = replace(s, "\\" => "\\\\")
128
129
rstinline(io::IO, s::AbstractString) = print(io, rstescape(s))
130
base/markdown/render/terminal/formatting.jl
@@ -51,7 +51,7 @@ end
51
# Wrapping
52
53
function ansi_length(s)
54
- replace(s, r"\e\[[0-9]+m", "") |> length
+ replace(s, r"\e\[[0-9]+m" => "") |> length
55
56
57
words(s) = split(s, " ")
base/markdown/render/terminal/render.jl
@@ -114,7 +114,7 @@ function terminline(io::IO, content::Vector)
114
115
116
function terminline(io::IO, md::AbstractString)
117
- print(io, replace(md, r"[\s\t\n]+", " "))
+ print(io, replace(md, r"[\s\t\n]+" => " "))
118
119
120
function terminline(io::IO, md::Bold)
base/methodshow.jl
@@ -203,7 +203,7 @@ function url(m::Method)
203
file = string(m.file)
204
line = m.line
205
line <= 0 || ismatch(r"In\[[0-9]+\]", file) && return ""
206
- Sys.iswindows() && (file = replace(file, '\\', '/'))
+ Sys.iswindows() && (file = replace(file, '\\' => '/'))
207
if inbase(M)
208
if isempty(Base.GIT_VERSION_INFO.commit)
209
# this url will only work if we're on a tagged release
base/pkg/reqs.jl
@@ -19,7 +19,7 @@ struct Requirement <: Line
19
system::Vector{AbstractString}
20
21
function Requirement(content::AbstractString)
22
- fields = split(replace(content, r"#.*$", ""))
+ fields = split(replace(content, r"#.*$" => ""))
23
system = AbstractString[]
24
while !isempty(fields) && fields[1][1] == '@'
25
push!(system,shift!(fields)[2:end])
base/process.jl
@@ -107,7 +107,7 @@ function show(io::IO, cmd::Cmd)
with_output_color(:underline, io) do io
print_shell_word(io, arg, shell_special)
- end, '`', "\\`")
+ end, '`' => "\\`")
111
end, ' '))
112
print(io, '`')
113
print_env && (print(io, ","); show(io, cmd.env))
0 commit comments