@@ -12,17 +12,15 @@ fn index() {
1212 assert_eq ! ( response. status( ) , Status :: Ok ) ;
1313 assert ! ( response
1414 . into_string( )
15- . map_or ( false , |s| s. contains( "Welcome!" ) ) ) ;
15+ . is_some_and ( |s| s. contains( "Welcome!" ) ) ) ;
1616}
1717
1818#[ test]
1919fn about ( ) {
2020 let client = Client :: untracked ( rocket ( ) ) . expect ( "valid rocket instance" ) ;
2121 let response = client. get ( "/about" ) . dispatch ( ) ;
2222 assert_eq ! ( response. status( ) , Status :: Ok ) ;
23- assert ! ( response
24- . into_string( )
25- . map_or( false , |s| s. contains( "About" ) ) ) ;
23+ assert ! ( response. into_string( ) . is_some_and( |s| s. contains( "About" ) ) ) ;
2624}
2725
2826#[ test]
@@ -32,7 +30,7 @@ fn add_get() {
3230 assert_eq ! ( response. status( ) , Status :: Ok ) ;
3331 assert ! ( response
3432 . into_string( )
35- . map_or ( false , |s| s. contains( "Add instance" ) ) ) ;
33+ . is_some_and ( |s| s. contains( "Add instance" ) ) ) ;
3634}
3735
3836#[ test]
@@ -46,15 +44,15 @@ fn add_post_error() {
4644 assert_eq ! ( response. status( ) , Status :: Ok ) ;
4745 assert ! ( response
4846 . into_string( )
49- . map_or ( false , |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
47+ . is_some_and ( |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
5048
5149 let response = client
5250 . post ( "/add" )
5351 . body ( "url=privatebin.info" )
5452 . header ( ContentType :: Form )
5553 . dispatch ( ) ;
5654 assert_eq ! ( response. status( ) , Status :: Ok ) ;
57- assert ! ( response. into_string( ) . map_or ( false , |s| s. contains(
55+ assert ! ( response. into_string( ) . is_some_and ( |s| s. contains(
5856 "Error adding URL privatebin.info, due to a failed scan within the last 5 minutes."
5957 ) ) ) ;
6058
@@ -67,7 +65,7 @@ fn add_post_error() {
6765 assert_eq ! ( response. status( ) , Status :: Ok ) ;
6866 assert ! ( response
6967 . into_string( )
70- . map_or ( false , |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
68+ . is_some_and ( |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
7169}
7270
7371#[ test]
@@ -79,8 +77,9 @@ fn add_post_success() {
7977 . header ( ContentType :: Form )
8078 . dispatch ( ) ;
8179 assert_eq ! ( response. status( ) , Status :: Ok ) ;
82- assert ! ( response. into_string( ) . map_or( false , |s| s
83- . contains( "Successfully added URL: https://privatebin.net" ) ) ) ;
80+ assert ! ( response
81+ . into_string( )
82+ . is_some_and( |s| s. contains( "Successfully added URL: https://privatebin.net" ) ) ) ;
8483}
8584
8685#[ test]
@@ -90,7 +89,7 @@ fn check_get() {
9089 assert_eq ! ( response. status( ) , Status :: Ok ) ;
9190 assert ! ( response
9291 . into_string( )
93- . map_or ( false , |s| s. contains( "Check instance" ) ) ) ;
92+ . is_some_and ( |s| s. contains( "Check instance" ) ) ) ;
9493}
9594
9695#[ test]
@@ -104,15 +103,15 @@ fn check_post_error() {
104103 assert_eq ! ( response. status( ) , Status :: Ok ) ;
105104 assert ! ( response
106105 . into_string( )
107- . map_or ( false , |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
106+ . is_some_and ( |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
108107
109108 let response = client
110109 . post ( "/check" )
111110 . body ( "url=privatebin.info" )
112111 . header ( ContentType :: Form )
113112 . dispatch ( ) ;
114113 assert_eq ! ( response. status( ) , Status :: Ok ) ;
115- assert ! ( response. into_string( ) . map_or ( false , |s| s. contains(
114+ assert ! ( response. into_string( ) . is_some_and ( |s| s. contains(
116115 "Error scanning URL privatebin.info, due to a failed scan within the last 5 minutes."
117116 ) ) ) ;
118117
@@ -125,7 +124,7 @@ fn check_post_error() {
125124 assert_eq ! ( response. status( ) , Status :: Ok ) ;
126125 assert ! ( response
127126 . into_string( )
128- . map_or ( false , |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
127+ . is_some_and ( |s| s. contains( "Not a valid URL: privatebin.info" ) ) ) ;
129128}
130129
131130#[ test]
@@ -137,8 +136,9 @@ fn check_post_success() {
137136 . header ( ContentType :: Form )
138137 . dispatch ( ) ;
139138 assert_eq ! ( response. status( ) , Status :: Ok ) ;
140- assert ! ( response. into_string( ) . map_or( false , |s| s
141- . contains( "Results of checking https://privatebin.net" ) ) ) ;
139+ assert ! ( response
140+ . into_string( )
141+ . is_some_and( |s| s. contains( "Results of checking https://privatebin.net" ) ) ) ;
142142}
143143
144144#[ test]
0 commit comments