style(treewide): Reformat

This commit is contained in:
Benedikt Peetz 2024-02-19 16:15:18 +01:00
parent 5a7bb00548
commit 03f8eda241
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
29 changed files with 2 additions and 31 deletions

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module is responsible for the config passed to trixy.
//! It works using the popular builder syntax:
//! ```no_run

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module generates the c header
//! It works by firstly listing the functions and then by grouping them into structures, effectively
//! simulating namespaces in c.

View File

@ -21,10 +21,10 @@
use proc_macro2::TokenStream as TokenStream2;
use quote::format_ident;
use trixy_parser::command_spec::{CommandSpec, Namespace, Identifier, Function};
use quote::quote;
use trixy_parser::command_spec::{CommandSpec, Function, Identifier, Namespace};
use crate::generate::{identifier_to_rust, c_api::mangle_c_function_ident};
use crate::generate::{c_api::mangle_c_function_ident, identifier_to_rust};
pub fn generate(trixy: &CommandSpec) -> String {
let struct_initializer: TokenStream2 = trixy
@ -83,4 +83,3 @@ fn namespace_to_struct_init(namespace: &Namespace) -> TokenStream2 {
. #ident = #ident ,
}
}

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use convert_case::{Case, Casing};
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use convert_case::{Case, Casing};
use proc_macro2::{Ident, TokenStream as TokenStream2};
use quote::{format_ident, quote};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module is responsible for generating the rust code used to interface with the api.
//! That includes the structs and enums declared in the trixy file and the enum used to describe the
//! command being executed.

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use trixy_parser::command_spec::{CommandSpec, Function, Identifier, NamedType, Type};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::{
env,
fs::{self, File},

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::{fs, path::PathBuf, process::exit};
use clap::{Parser, Subcommand};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module contains the already type checked types.
use std::fmt::{Display, Write};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module provides the type definitions for the parser.
//! These types are split into type-checked ones [`checked`] and the raw types [`unchecked`]

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! This module contains the not type checked types.
//! These are generated on the first pass of the parser, to be later converted into the checked
//! ones.

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use core::fmt;
use thiserror::Error;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::{error::Error, fmt::Display};
use thiserror::Error;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::fmt::Display;
use self::{error::SpannedLexingError, tokenizer::Tokenizer};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use crate::lexing::{Keyword, Token, TokenKind, TokenSpan};
use super::TokenStream;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
// This code is heavily inspired by: https://michael-f-bryan.github.io/static-analyser-in-rust/book/lex.html
use crate::{

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use error::TrixyError;
use crate::lexing::TokenStream;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use thiserror::Error;
use std::{error::Error, fmt::Display};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::mem;
use convert_case::{Case, Casing};

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use crate::command_spec::checked::{
Attribute, CommandSpec, DocIdentifier, DocNamedType, Enumeration, Function, Identifier,
NamedType, Namespace, Structure, Type,

View File

@ -19,6 +19,5 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
pub mod checked;
pub mod unchecked;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::{error::Error, fmt::Display};
use thiserror::Error;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::mem;
use crate::{

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use pretty_assertions::assert_eq;
use crate::{

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use std::ffi::c_char;
use thiserror::Error;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
//! Trixy contains the types used by the [`trixy-macros`] crate to provide ffi safe types
pub mod error;
pub mod traits;

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
use core::slice;
use std::{
cell::RefCell,

View File

@ -19,7 +19,6 @@
* If not, see <https://www.gnu.org/licenses/>.
*/
pub mod convert_trait;
pub mod errno;
mod try_from_impl;