File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ impl Index {
110110pub struct ResultsIterator < ' idx > {
111111 inner : * mut RSResultsIterator ,
112112 index : & ' idx Index ,
113- is_empty : bool ,
114113}
115114
116115impl < ' idx > ResultsIterator < ' idx > {
@@ -119,8 +118,6 @@ impl<'idx> ResultsIterator<'idx> {
119118 index : & ' idx Index ,
120119 err_buf : Vec < u8 > ,
121120 ) -> Result < Self , RedisError > {
122- let mut is_empty = false ;
123-
124121 if results_iter. is_null ( ) {
125122 // Either we encountered an error, or there are no results.
126123 let err = String :: from_utf8 ( err_buf) ?;
@@ -129,15 +126,11 @@ impl<'idx> ResultsIterator<'idx> {
129126 if err. len ( ) > 0 {
130127 return Err ( err. into ( ) ) ;
131128 }
132-
133- // No results.
134- is_empty = true ;
135129 }
136130
137131 Ok ( Self {
138132 inner : results_iter,
139133 index,
140- is_empty,
141134 } )
142135 }
143136}
@@ -146,7 +139,8 @@ impl Iterator for ResultsIterator<'_> {
146139 type Item = String ;
147140
148141 fn next ( & mut self ) -> Option < Self :: Item > {
149- if self . is_empty {
142+ if self . inner . is_null ( ) {
143+ // A null pointer means we have no results.
150144 return None ;
151145 }
152146
You can’t perform that action at this time.
0 commit comments