Add rule to use range operator
This commit is contained in:
Родитель
d30bf271ad
Коммит
cad5b732a5
|
@ -218,6 +218,9 @@ csharp_style_prefer_index_operator = true:error
|
|||
# IDE0032: Use auto property
|
||||
dotnet_style_prefer_auto_properties = true:error
|
||||
|
||||
# IDE0057: Use range operator
|
||||
csharp_style_prefer_range_operator = true:error
|
||||
|
||||
[*.xaml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace WalletWasabi.Gui.Behaviors
|
|||
{
|
||||
return "";
|
||||
}
|
||||
return text.Substring(start, end - start);
|
||||
return text[start..end];
|
||||
}
|
||||
|
||||
protected override void OnAttached()
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
|
|||
{
|
||||
if (PinInput.Length > 0)
|
||||
{
|
||||
PinInput = PinInput.Substring(0, PinInput.Length - 1);
|
||||
PinInput = PinInput[0..^1];
|
||||
}
|
||||
}
|
||||
else if (arg == "CLEAR")
|
||||
|
|
|
@ -575,7 +575,7 @@ namespace WalletWasabi.Packager
|
|||
process.WaitForExit();
|
||||
}
|
||||
|
||||
var daemonExePath = newExecutablePath.Substring(0, newExecutablePath.Length - 4) + "d.exe";
|
||||
var daemonExePath = newExecutablePath[0..^4] + "d.exe";
|
||||
File.Copy(newExecutablePath, daemonExePath);
|
||||
|
||||
// Do not open console.
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace WalletWasabi.Helpers
|
|||
{
|
||||
originalPassword,
|
||||
buggyClipboard, // Should be here for every OP system. If I create a buggy wallet on OSX and transfer it to other system, it should also work.
|
||||
$"{buggyClipboard.Substring(0,buggyClipboard.Length-1)}\ufffd" // Later I tested the functionality and experienced that the last character replaced by invalid character.
|
||||
$"{buggyClipboard[0..^1]}\ufffd" // Later I tested the functionality and experienced that the last character replaced by invalid character.
|
||||
};
|
||||
|
||||
return possiblePasswords.ToArray();
|
||||
|
|
|
@ -370,7 +370,7 @@ namespace Mono.Options
|
|||
nameof(Prototype));
|
||||
}
|
||||
|
||||
seps.Add(name.Substring(start, i - start));
|
||||
seps.Add(name[start..i]);
|
||||
start = -1;
|
||||
break;
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ namespace Mono.Options
|
|||
Option p;
|
||||
string rn;
|
||||
if (n.Length >= 1 && (n[^1] == '+' || n[^1] == '-') &&
|
||||
Contains((rn = n.Substring(0, n.Length - 1))))
|
||||
Contains((rn = n[0..^1])))
|
||||
{
|
||||
p = this[rn];
|
||||
string v = n[^1] == '+' ? option : null;
|
||||
|
@ -968,7 +968,7 @@ namespace Mono.Options
|
|||
}
|
||||
else
|
||||
{
|
||||
sb.Append(description.Substring(start, i - start));
|
||||
sb.Append(description[start..i]);
|
||||
start = -1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -206,7 +206,7 @@ namespace Mono.Options
|
|||
--end;
|
||||
continuation = "-";
|
||||
}
|
||||
string line = self.Substring(start, end - start) + continuation;
|
||||
string line = self[start..end] + continuation;
|
||||
yield return line;
|
||||
start = end;
|
||||
if (char.IsWhiteSpace(c))
|
||||
|
|
Загрузка…
Ссылка в новой задаче