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

No way to create LoginUrl instance #298

Closed
gabelluardo opened this issue Oct 21, 2020 · 4 comments
Closed

No way to create LoginUrl instance #298

gabelluardo opened this issue Oct 21, 2020 · 4 comments
Assignees
Labels
FIXME good first issue Good for newcomers

Comments

@gabelluardo
Copy link

Is there an example for LoginUrl? I tried

let login_url = LoginUrl {
    url: "my_url".to_string(),
    forward_text: None,
    bot_username: None,
    request_write_access: None,
};

but it gives me cannot create non-exhaustive struct using struct expression

@p0lunin p0lunin added the K-question Kind: a question, not necesseraly an issue label Oct 21, 2020
@p0lunin
Copy link
Collaborator

p0lunin commented Oct 21, 2020

Hmm, there are no way to build LoginUrl (link).

@p0lunin p0lunin added K-bug Kind: bug good first issue Good for newcomers and removed K-question Kind: a question, not necesseraly an issue labels Oct 21, 2020
@p0lunin p0lunin changed the title LoginUrl example No way to create LoginUrl instance Oct 21, 2020
@Hirrolot Hirrolot removed the K-bug Kind: bug label Oct 21, 2020
@Hirrolot
Copy link
Collaborator

Hirrolot commented Oct 21, 2020

There's work-in-progress teloxide-core, in which we have removed all the #[non_exhaustive] annotations, but it needs more time to be finished. As a quick fix, you can put teloxide into your crate as a separate workspace and remove #[non_exhaustive] on LoginUrl, then your code should compile successfully.

Tomorrow I will fix it by adding LoginUrl::new and upload v0.3.2 to crates.io.

@WaffleLapkin
Copy link
Member

Fixed in #299 I suppose

@Hirrolot
Copy link
Collaborator

Yes, I've just published v0.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIXME good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants