Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take parameters by value instead of reference #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target/
/.vscode/
/.vscode/
.idea
8 changes: 4 additions & 4 deletions kalshi/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ impl<'a> Kalshi {
/// ```
/// kalshi_instance.login("[email protected]", "example_password").await?;
/// ```
pub async fn login(&mut self, user: &str, password: &str) -> Result<(), KalshiError> {
let login_url: &str = &format!("{}/login", self.base_url.to_string());
pub async fn login(&mut self, user: String, password: String) -> Result<(), KalshiError> {
let login_url = format!("{}/login", self.base_url);

let login_payload = LoginPayload {
email: user.to_string(),
password: password.to_string(),
email: user,
password,
};

let result: LoginResponse = self
Expand Down