Skip to content

Commit a48b197

Browse files
committed
made reference to leetcode struct immutable
Signed-off-by: dvishal485 <dvishal485@gmail.com>
1 parent d27edf1 commit a48b197

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/leetcode_api/leetcode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl LeetCode {
2525
impl LeetCode<Unauthorized> {
2626
/// # Authenticate with cookie
2727
/// Builds a new reqwest client with the cookie
28-
pub fn authenticate(&mut self, cookie: &str) -> Result<LeetCode<Authorized>, &str> {
28+
pub fn authenticate(&self, cookie: &str) -> Result<LeetCode<Authorized>, &str> {
2929
let mut headers = reqwest::header::HeaderMap::with_capacity(5);
3030
let Some(csrf_token) = cookie
3131
.split(';')

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ fn main() -> ExitCode {
8080
return ExitCode::FAILURE;
8181
};
8282

83-
let mut leetcode = LeetCode::new();
84-
let lc = leetcode.authenticate(cookie).unwrap();
83+
let lc = LeetCode::new();
84+
let lc = lc.authenticate(cookie).unwrap();
8585

8686
if let None = cli.command {
8787
println!(

0 commit comments

Comments
 (0)