Skip to content

Commit d2e16bd

Browse files
committed
Add scope attributes
1 parent 340f784 commit d2e16bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/mimeapps.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ unittest
5656
assert(t.media == string.init && t.subtype == string.init);
5757
}
5858

59-
private @nogc @trusted bool allSymbolsAreValid(const(char)[] name) nothrow pure
59+
private @nogc @trusted bool allSymbolsAreValid(scope const(char)[] name) nothrow pure
6060
{
6161
import std.ascii : isAlpha, isDigit;
6262
for (size_t i=0; i<name.length; ++i) {
@@ -68,7 +68,7 @@ private @nogc @trusted bool allSymbolsAreValid(const(char)[] name) nothrow pure
6868
return true;
6969
}
7070

71-
private @nogc @safe bool isValidMimeTypeName(const(char)[] name) nothrow pure
71+
private @nogc @safe bool isValidMimeTypeName(scope const(char)[] name) nothrow pure
7272
{
7373
auto t = parseMimeTypeName(name);
7474
return t.media.length && t.subtype.length && allSymbolsAreValid(t.media) && allSymbolsAreValid(t.subtype);
@@ -1185,7 +1185,7 @@ struct AssociationUpdateQuery
11851185
/**
11861186
* Apply query to $(D MimeAppsListFile).
11871187
*/
1188-
@safe void apply(MimeAppsListFile file) const
1188+
@safe void apply(scope MimeAppsListFile file) const
11891189
{
11901190
foreach(op; _operations)
11911191
{
@@ -1234,7 +1234,7 @@ unittest
12341234
* $(D inilike.file.IniLikeReadException) if errors occured duting reading of file.
12351235
* $(B ErrnoException) if errors occured during file writing.
12361236
*/
1237-
@trusted void updateAssociations(string fileName, ref AssociationUpdateQuery query)
1237+
@trusted void updateAssociations(string fileName, ref scope const AssociationUpdateQuery query)
12381238
{
12391239
MimeAppsListFile file;
12401240
if (fileName.exists) {
@@ -1258,7 +1258,7 @@ static if (isFreedesktop)
12581258
* Warning: $(RED Since this library is in development this function should be used with care.
12591259
* Developer can't guarantee yet that it will not damage your file associations settings.)
12601260
*/
1261-
@safe void updateAssociations(ref AssociationUpdateQuery query)
1261+
@safe void updateAssociations(ref scope const AssociationUpdateQuery query)
12621262
{
12631263
foreach(fileName; writableMimeAppsListPaths()) {
12641264
updateAssociations(fileName, query);

0 commit comments

Comments
 (0)