Skip to content

Commit 007dc66

Browse files
committedMay 18, 2019
Fix rubocop Style/IfUnlessModifier
Addressing: lib/openscap/source.rb:40:7: C: Style/IfUnlessModifier: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||. unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero? ^^^^^^
1 parent 905eb64 commit 007dc66

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎lib/openscap/source.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def type
3737

3838
def validate!
3939
e = FFI::MemoryPointer.new(:char, 4096)
40-
unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
41-
OpenSCAP.raise! e.read_string
42-
end
40+
OpenSCAP.raise!(e.read_string) unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
4341
end
4442

4543
def save(filepath = nil)

0 commit comments

Comments
 (0)
Please sign in to comment.