Skip to content

Commit 26ec854

Browse files
committed
Remove some use of unstable apis
1 parent 369cb1b commit 26ec854

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl IntoConnectParams for Url {
170170
host,
171171
port,
172172
user,
173-
path: url::Path { path, query: options, .. },
173+
path: url::Path { mut path, query: options, .. },
174174
..
175175
} = self;
176176

@@ -195,8 +195,13 @@ impl IntoConnectParams for Url {
195195
UserInfo { user: user, password: pass }
196196
});
197197

198-
// path contains the leading /
199-
let database = path.slice_shift_char().map(|(_, path)| path.to_owned());
198+
let database = if path.is_empty() {
199+
None
200+
} else {
201+
// path contains the leading /
202+
path.remove(0);
203+
Some(path)
204+
};
200205

201206
Ok(ConnectParams {
202207
target: target,

0 commit comments

Comments
 (0)