-
Notifications
You must be signed in to change notification settings - Fork 126
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
Update Mtproto TL types #236
Update Mtproto TL types #236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mtproto.tl
doesn't need to be updated (not under normal circumstances anyway).
I'd be fine merging some of the other improvements though, which I suspect were all linted by a tool like Clippy. But we need to revert mtproto.tl
.
@@ -42,8 +40,8 @@ async fn async_main() -> Result<()> { | |||
.init() | |||
.unwrap(); | |||
|
|||
let api_id = env!("TG_ID").parse().expect("TG_ID invalid"); | |||
let api_hash = env!("TG_HASH").to_string(); | |||
let api_id = std::env::var("TG_ID")?.parse().expect("TG_ID invalid"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this. The use of env!
is intentional, because developers should be compiling the values into the hinary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about add a .cargo/config.toml
[env]
TG_ID = ""
TG_HASH = ""
to avoid error message in example files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that works, and they can still by overriden by the user, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file don't seem correct.
lib/grammers-tl-types/tl/mtproto.tl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While bytes
and string
are synonyms in TL, they're definitely not in Rust.
The Rust String must contain valid UTF-8, and none of the changed types in this file are guaranteed to be valid UTF-8 (and most likely they aren't).
In general, this file shouldn't be updated.
There's a bunch of changes mushed together in a single PR, but it is worth separating them in to separate PRs and discussing separately. |
No description provided.