 }
 
 public func contain(_ substrings: [String]) -> Predicate<String> {
-    return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
-        failureMessage.postfixMessage = "contain <\(arrayAsString(substrings))>"
+    return Predicate.simple("contain <\(arrayAsString(substrings))>") { actualExpression in
         if let actual = try actualExpression.evaluate() {
-            return substrings.all {
+            let matches = substrings.all {
                 let range = actual.range(of: $0)
                 return range != nil && !range!.isEmpty
             }
+            return PredicateStatus(bool: matches)
         }
-        return false
-    }.requireNonNil
+        return .fail
+    }
 }
 
 /// A Nimble matcher that succeeds when the actual string contains the expected substring.

}

public func contain(_ items: [Any?]) -> Predicate<NMBContainer> {
    return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
        failureMessage.postfixMessage = "contain <\(arrayAsString(items))>"
        guard let actual = try actualExpression.evaluate() else { return false }
        return items.all { item in
            return item != nil && actual.contains(item!)
        }
    }.requireNonNil
}

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)

}

public func contain(_ substrings: [NSString]) -> Predicate<NSString> {
    return Predicate.simple("contain <\(arrayAsString(substrings))>") { actualExpression in
        if let actual = try actualExpression.evaluate() {
            let matches = substrings.all { actual.range(of: $0.description).length != 0 }
            return PredicateStatus(bool: matches)
        }
        return .fail
    }
}

/// A Nimble matcher that succeeds when the actual collection contains the expected object.
