Skip to content

Commit 4c4059a

Browse files
committed
Propagate changes from tokio-postgres to postgres.
1 parent 98814b8 commit 4c4059a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

postgres/src/config.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use tokio_postgres::{Error, Socket};
2929
///
3030
/// ## Keys
3131
///
32-
/// * `user` - The username to authenticate with. Required.
32+
/// * `user` - The username to authenticate with. Defaults to the user executing this process.
3333
/// * `password` - The password to authenticate with.
3434
/// * `dbname` - The name of the database to connect to. Defaults to the username.
3535
/// * `options` - Command line options used to configure the server.
@@ -143,15 +143,16 @@ impl Config {
143143

144144
/// Sets the user to authenticate with.
145145
///
146-
/// Required.
146+
/// If the user is not set, then this defaults to the user executing this process.
147147
pub fn user(&mut self, user: &str) -> &mut Config {
148148
self.config.user(user);
149149
self
150150
}
151151

152-
/// Gets the user to authenticate with, if one has been configured with
153-
/// the `user` method.
154-
pub fn get_user(&self) -> Option<&str> {
152+
/// Gets the user to authenticate with.
153+
/// If no user has been configured with the [`user`](Config::user) method,
154+
/// then this defaults to the user executing this process.
155+
pub fn get_user(&self) -> &str {
155156
self.config.get_user()
156157
}
157158

0 commit comments

Comments
 (0)