@@ -8,11 +8,11 @@ use std::os::raw::c_char;
88
99use alloc:: borrow:: ToOwned ;
1010use objc2:: ffi;
11- use objc2:: msg_send;
1211use objc2:: rc:: DefaultId ;
1312use objc2:: rc:: { autoreleasepool, AutoreleasePool } ;
1413use objc2:: rc:: { Id , Shared } ;
15- use objc2:: runtime:: { Bool , Class , Object } ;
14+ use objc2:: runtime:: { Class , Object } ;
15+ use objc2:: { msg_send, msg_send_bool} ;
1616
1717use crate :: { NSComparisonResult , NSCopying , NSMutableCopying , NSMutableString , NSObject } ;
1818
@@ -182,8 +182,7 @@ impl NSString {
182182 #[ doc( alias = "hasPrefix" ) ]
183183 #[ doc( alias = "hasPrefix:" ) ]
184184 pub fn has_prefix ( & self , prefix : & NSString ) -> bool {
185- let res: Bool = unsafe { msg_send ! [ self , hasPrefix: prefix] } ;
186- res. is_true ( )
185+ unsafe { msg_send_bool ! [ self , hasPrefix: prefix] }
187186 }
188187
189188 /// Whether the given string matches the ending characters of this string.
@@ -192,8 +191,7 @@ impl NSString {
192191 #[ doc( alias = "hasSuffix" ) ]
193192 #[ doc( alias = "hasSuffix:" ) ]
194193 pub fn has_suffix ( & self , suffix : & NSString ) -> bool {
195- let res: Bool = unsafe { msg_send ! [ self , hasSuffix: suffix] } ;
196- res. is_true ( )
194+ unsafe { msg_send_bool ! [ self , hasSuffix: suffix] }
197195 }
198196
199197 // pub fn from_nsrange(range: NSRange) -> Id<Self, Shared>
0 commit comments