@@ -29,7 +29,7 @@ use tokio_postgres::{Error, Socket};
29
29
///
30
30
/// ## Keys
31
31
///
32
- /// * `user` - The username to authenticate with.Required .
32
+ /// * `user` - The username to authenticate with.Defaults to the user executing this process .
33
33
/// * `password` - The password to authenticate with.
34
34
/// * `dbname` - The name of the database to connect to. Defaults to the username.
35
35
/// * `options` - Command line options used to configure the server.
@@ -143,15 +143,16 @@ impl Config {
143
143
144
144
/// Sets the user to authenticate with.
145
145
///
146
- ///Required .
146
+ ///If the user is not set, then this defaults to the user executing this process .
147
147
pub fn user ( & mut self , user : & str ) ->& mut Config {
148
148
self . config . user ( user) ;
149
149
self
150
150
}
151
151
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 {
155
156
self . config . get_user ( )
156
157
}
157
158