@@ -56,7 +56,7 @@ pub enum ClientStorage {
5656impl ClientStorage {
5757 /// Create new client storage.
5858 pub async fn new_unauthenticated (
59- account_id : AccountId ,
59+ account_id : & AccountId ,
6060 target : BackendTarget ,
6161 ) -> Result < Self > {
6262 match target {
@@ -71,7 +71,7 @@ impl ClientStorage {
7171
7272 /// Create new client storage in authenticated state.
7373 pub async fn new_authenticated (
74- account_id : AccountId ,
74+ account_id : & AccountId ,
7575 target : BackendTarget ,
7676 authenticated_user : Identity ,
7777 ) -> Result < Self > {
@@ -97,9 +97,11 @@ impl ClientStorage {
9797
9898 /// Create new file system storage.
9999 async fn new_unauthenticated_fs (
100- account_id : AccountId ,
100+ account_id : & AccountId ,
101101 paths : Paths ,
102102 ) -> Result < Self > {
103+ debug_assert ! ( !paths. is_server( ) ) ;
104+
103105 Ok ( Self :: FileSystem (
104106 ClientFileSystemStorage :: new_unauthenticated ( account_id, paths)
105107 . await ?,
@@ -108,56 +110,36 @@ impl ClientStorage {
108110
109111 /// Create new file system storage in authenticated state.
110112 async fn new_authenticated_fs (
111- account_id : AccountId ,
113+ account_id : & AccountId ,
112114 paths : Paths ,
113115 authenticated_user : Identity ,
114116 ) -> Result < Self > {
117+ debug_assert ! ( !paths. is_server( ) ) ;
118+
115119 Ok ( Self :: FileSystem (
116120 ClientFileSystemStorage :: new_authenticated (
117121 account_id,
118122 paths,
119123 authenticated_user,
120- /*
121- identity_log,
122- device,
123- */
124124 )
125125 . await ?,
126126 ) )
127127 }
128128
129129 /// Create new file system storage.
130130 async fn new_unauthenticated_db (
131- account_id : AccountId ,
131+ account_id : & AccountId ,
132132 client : Client ,
133133 ) -> Result < Self > {
134- /*
135- Ok(Self::FileSystem(
136- ClientFileSystemStorage::new_unauthenticated(account_id, paths).await?,
137- ))
138- */
139-
140134 todo ! ( "unauthenticated db storage" ) ;
141135 }
142136
143137 /// Create new file system storage in authenticated state.
144138 async fn new_authenticated_db (
145- account_id : AccountId ,
139+ account_id : & AccountId ,
146140 client : Client ,
147141 authenticated_user : Identity ,
148142 ) -> Result < Self > {
149- /*
150- Ok(Self::FileSystem(
151- ClientFileSystemStorage::new_authenticated(
152- account_id,
153- paths,
154- identity_log,
155- device,
156- )
157- .await?,
158- ))
159- */
160-
161143 todo ! ( "authenticated db storage" ) ;
162144 }
163145}
0 commit comments