File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11use serde:: { Deserialize , Serialize } ;
2+ use std:: collections:: HashSet ;
23
34#[ derive( Serialize , Deserialize , Debug ) ]
45#[ cfg_attr( feature = "utoipa" , derive( utoipa:: ToSchema ) ) ]
56pub struct GetUserIdentityResponse {
67 pub user_id : String ,
78 pub tenant : String ,
8- pub databases : Vec < String > ,
9+ pub databases : HashSet < String > ,
910}
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ impl ChromaHttpClient {
349349 ) ) ;
350350 }
351351
352- let database_name = identity. databases . first ( ) . ok_or_else ( || {
352+ let database_name = identity. databases . into_iter ( ) . next ( ) . ok_or_else ( || {
353353 ChromaClientError :: CouldNotResolveDatabaseId (
354354 "Client has access to no databases" . to_string ( ) ,
355355 )
Original file line number Diff line number Diff line change 1+ use std:: collections:: HashSet ;
12use std:: fmt:: { Display , Formatter } ;
23use std:: future:: { ready, Future } ;
34use std:: pin:: Pin ;
@@ -122,7 +123,7 @@ fn default_identity() -> GetUserIdentityResponse {
122123 GetUserIdentityResponse {
123124 user_id : String :: new ( ) ,
124125 tenant : "default_tenant" . to_string ( ) ,
125- databases : vec ! [ "default_database" . to_string( ) ] ,
126+ databases : HashSet :: from ( [ "default_database" . to_string ( ) ] ) ,
126127 }
127128}
128129
You can’t perform that action at this time.
0 commit comments