Skip to content
Extraits de code Groupes Projets
Vérifiée Valider d0c2893d rédigé par Kubat's avatar Kubat
Parcourir les fichiers

RUST: Use forbit unsafe for where we can to enforce the use of unsafe code...

RUST: Use forbit unsafe for where we can to enforce the use of unsafe code only in the c compat crate
parent 01d16aaf
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#![forbid(unsafe_code)]
fn main() {}
#![forbid(unsafe_code)]
//! The base library used for lektor's clients. It is composed of elements to
//! communicate with the lektord server and elements to store and organise the
//! queried informations.
......
#![forbid(unsafe_code)]
mod asserts;
mod error;
mod macros;
......
#![forbid(unsafe_code)]
mod args;
mod config;
mod parsers;
......@@ -35,7 +37,7 @@ macro_rules! send {
($conn: expr => $query: expr ; $expect: pat_param => $action: block) => {
match $conn.send($query).await.expect("failed to execute command") {
$expect => $action,
_ => panic!("invalid response type for command"),
_ => unreachable!("invalid response type for command"),
}
};
......@@ -96,14 +98,12 @@ async fn handle_cmd_playlist(
send!(conn => LektorQuery::RemoveFromPlaylist(name, query); ok)
}
LktPlaylistCommand::List => {
send!(conn => LektorQuery::ListAllPlaylists
; LektorResponse::PlaylistSet(playlists) => {
send!(conn => LektorQuery::ListAllPlaylists; LektorResponse::PlaylistSet(playlists) => {
playlists.into_iter().for_each(|plt| println!("{plt}"))
})
}
LktPlaylistCommand::ListContent { name } => {
send!(conn => LektorQuery::ListPlaylist(name)
; LektorResponse::KaraSet(karas) => {
send!(conn => LektorQuery::ListPlaylist(name); LektorResponse::KaraSet(karas) => {
karas.into_iter().for_each(|kara| println!("{kara}"))
})
}
......
#![forbid(unsafe_code)]
pub mod v1;
#![forbid(unsafe_code)]
//! Database implementation in rust for lektor.
pub mod connexion;
......
#![forbid(unsafe_code)]
//! The crate responsible of downloading karas from kurisu.
use lektor_c_compat::rs::*;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter