Skip to content

Commit

Permalink
Deny unsafe code in all crates
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jun 12, 2024
1 parent f5d167c commit b9a582a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/grammers-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

//! This library is a high-level implementation to access [Telegram's API], which essentially
//! lets you automate everything you can do with official Telegram clients and more from Rust,
//! or even control bot accounts, making it a viable alternative to using the [Telegram Bot API].
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

pub mod aes;
mod auth_key;
pub mod factorize;
Expand Down
2 changes: 2 additions & 0 deletions lib/grammers-mtproto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

//! This library is an implementation of the [Mobile Transport Protocol].
//!
//! It is capable of efficiently packing enqueued requests into message
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-mtsender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

mod errors;
mod reconnection;

Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

mod chat;
mod generated;
mod message_box;
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-tl-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

//! This module gathers all the code generation submodules and coordinates
//! them, feeding them the right data.
#![deny(unsafe_code)]

mod enums;
mod grouper;
mod metadata;
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-tl-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//! [Type Language]: https://core.telegram.org/mtproto/TL
//! [`parse_tl_file`]: fn.parse_tl_file.html
//! [`Definition`]: tl/struct.Definition.html
#![deny(unsafe_code)]

pub mod errors;
pub mod tl;
mod tl_iterator;
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers-tl-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
//! [`Serializable`]: trait.Serializable.html
//! [`Deserializable`]: trait.Deserializable.html
//! [`LAYER`]: constant.LAYER.html
#![deny(unsafe_code)]

pub mod deserialize;
mod generated;
pub mod serialize;
Expand Down
3 changes: 3 additions & 0 deletions lib/grammers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(unsafe_code)]

fn main() {
println!("Hello, world!");
}

0 comments on commit b9a582a

Please sign in to comment.