Skip to content

Commit 4ba43ac

Browse files
committed
Allow changing URL password.
1 parent c5a7e66 commit 4ba43ac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gix-url/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ impl Url {
124124
self.user = user;
125125
prev
126126
}
127+
128+
/// Set the given `password`, or unset it with `None`. Return the previous value.
129+
pub fn set_password(&mut self, password: Option<String>) -> Option<String> {
130+
let prev = self.password.take();
131+
self.password = password;
132+
prev
133+
}
127134
}
128135

129136
/// Builder

0 commit comments

Comments
 (0)