Skip to content

Commit 64a773a

Browse files
authored
Add type restrictions to Dir (#15697)
1 parent 0728cb5 commit 64a773a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dir.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ class Dir
284284
# Dir.mkdir("testdir")
285285
# Dir.exists?("testdir") # => true
286286
# ```
287-
def self.mkdir(path : Path | String, mode = 0o777) : Nil
287+
def self.mkdir(path : Path | String, mode : Int32 = 0o777) : Nil
288288
Crystal::System::Dir.create(path.to_s, mode)
289289
end
290290

291291
# Creates a new directory at the given path, including any non-existing
292292
# intermediate directories. The linux-style permission mode can be specified,
293293
# with a default of 777 (0o777).
294-
def self.mkdir_p(path : Path | String, mode = 0o777) : Nil
294+
def self.mkdir_p(path : Path | String, mode : Int32 = 0o777) : Nil
295295
return if Dir.exists?(path)
296296

297297
path = Path.new path

src/dir/glob.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Dir
6464
# equivalent to
6565
# `match: File::MatchOptions.glob_default | File::MatchOptions::DotFiles`.
6666
@[Deprecated("Use the overload with a `match` parameter instead")]
67-
def self.glob(*patterns : Path | String, match_hidden, follow_symlinks = false) : Array(String)
67+
def self.glob(*patterns : Path | String, match_hidden : Bool, follow_symlinks : Bool = false) : Array(String)
6868
glob(patterns, match: match_hidden_to_options(match_hidden), follow_symlinks: follow_symlinks)
6969
end
7070

0 commit comments

Comments
 (0)