Skip to main content

RCS1005: Simplify nested using statement

Properties

PropertyValue
Default SeverityHidden
Minimum language version-

Examples

Example #1

diagnostic.cs
using (var fs = new FileStream("path", FileMode.OpenOrCreate))
{
using (var sr = new StreamReader(fs))
{
}
}
fix.cs
using (var fs = new FileStream("path", FileMode.OpenOrCreate))
using (var sr = new StreamReader(fs))
{
}

Applies to