mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Merge pull request #1964 from tom-tan/safe-some-methods-std-stdio
Mark std.stdio.File.this(this), isOpen, name and getFP as `@safe`
This commit is contained in:
commit
7bd1ae66c3
1 changed files with 4 additions and 4 deletions
|
@ -360,7 +360,7 @@ Throws: $(D ErrnoException) if the file could not be opened.
|
|||
detach();
|
||||
}
|
||||
|
||||
this(this)
|
||||
this(this) @safe
|
||||
{
|
||||
if (!_p) return;
|
||||
assert(_p.refs);
|
||||
|
@ -503,7 +503,7 @@ Throws: $(D ErrnoException) in case of error.
|
|||
|
||||
|
||||
/** Returns $(D true) if the file is opened. */
|
||||
@property bool isOpen() const pure nothrow
|
||||
@property bool isOpen() const @safe pure nothrow
|
||||
{
|
||||
return _p !is null && _p.handle;
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ Throws: $(D Exception) if the file is not opened.
|
|||
/** Returns the name of the last opened file, if any.
|
||||
If a $(D File) was created with $(LREF tmpfile) and $(LREF wrapFile)
|
||||
it has no name.*/
|
||||
@property string name() const pure nothrow
|
||||
@property string name() const @safe pure nothrow
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
@ -1456,7 +1456,7 @@ Note that the created file has no $(LREF name)*/
|
|||
/**
|
||||
Returns the $(D FILE*) corresponding to this object.
|
||||
*/
|
||||
FILE* getFP() pure
|
||||
FILE* getFP() @safe pure
|
||||
{
|
||||
import std.exception : enforce;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue