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

Constructing a new AtSign should only require &str #6

Open
Zambrella opened this issue Jul 3, 2023 · 0 comments
Open

Constructing a new AtSign should only require &str #6

Zambrella opened this issue Jul 3, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Zambrella
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Calling read_data(...) in a loop requires cloning and constructing new AtSign object each time.

loop {
        let at_contact = AtSign::new(contact.clone());
        at_client
            .read_data(at_contact, "attalk")
            .expect("Failed to read data");
        thread::sleep(time::Duration::from_secs(4));
    }

Describe the solution you'd like

There is no reason for the AtSign::new() associated function to require String when &str will do. The same is true of the read_data(...) method.

Describe alternatives you've considered

No response

Additional context

No response

@Zambrella Zambrella added enhancement New feature or request good first issue Good for newcomers labels Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant