Skip to content

Commit

Permalink
chore: Format
Browse files Browse the repository at this point in the history
  • Loading branch information
GrayJack committed Nov 20, 2024
1 parent d6333db commit 9aea46a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion examples/janet_native_module.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! For a more complete example to create a Janet package with jpm, check out [this
//! template repository](https://github.com/GrayJack/rust-janet-module-template)

use janetrs::{declare_janet_mod, janet_fn, Janet, JanetArgs, JanetTuple, TaggedJanet};
use janetrs::{Janet, JanetArgs, JanetTuple, TaggedJanet, declare_janet_mod, janet_fn};

/// (template/hello)
///
Expand Down
4 changes: 2 additions & 2 deletions janetrs_macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
extern crate proc_macro;
use proc_macro::TokenStream;

use quote::{quote, quote_spanned, ToTokens};
use quote::{ToTokens, quote, quote_spanned};
use syn::{parse_macro_input, spanned::Spanned};

use janetrs_version::JanetVersion;

mod utils;
use utils::{janet_path_checker, Arg, Args, ArityArgs, JanetVersionArgs};
use utils::{Arg, Args, ArityArgs, JanetVersionArgs, janet_path_checker};

use crate::utils::ModArgs;

Expand Down
2 changes: 1 addition & 1 deletion janetrs_macros/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use proc_macro2::Span;
use quote::ToTokens;
use syn::{parse::Parse, punctuated::Punctuated, spanned::Spanned, LitStr, Token};
use syn::{LitStr, Token, parse::Parse, punctuated::Punctuated, spanned::Spanned};

/// Macro inspired by `anyhow::anyhow!` to create a compiler error with the given span.
macro_rules! err_spanned {
Expand Down
12 changes: 6 additions & 6 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use core::{
use std::{error::Error as StdError, thread_local};

use crate::{
env::{CFunOptions, DefOptions, JanetEnvironment, VarOptions},
Janet, JanetTable,
env::{CFunOptions, DefOptions, JanetEnvironment, VarOptions},
};

// There are platforms where AtomicBool doesn't exist
Expand Down Expand Up @@ -168,7 +168,7 @@ impl JanetClient {
///
/// # Examples
/// ```
/// use janetrs::{client::JanetClient, env::DefOptions, Janet};
/// use janetrs::{Janet, client::JanetClient, env::DefOptions};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let mut client = JanetClient::init()?;
/// assert!(client.env().is_none());
Expand Down Expand Up @@ -197,7 +197,7 @@ impl JanetClient {
///
/// # Examples
/// ```
/// use janetrs::{client::JanetClient, env::VarOptions, Janet};
/// use janetrs::{Janet, client::JanetClient, env::VarOptions};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let mut client = JanetClient::init()?;
/// assert!(client.env().is_none());
Expand Down Expand Up @@ -226,7 +226,7 @@ impl JanetClient {
///
/// # Examples
/// ```
/// use janetrs::{client::JanetClient, env::CFunOptions, janet_fn, Janet, JanetType};
/// use janetrs::{Janet, JanetType, client::JanetClient, env::CFunOptions, janet_fn};
///
/// #[janet_fn]
/// fn test(_args: &mut [Janet]) -> Janet {
Expand Down Expand Up @@ -263,7 +263,7 @@ impl JanetClient {
///
/// # Examples
/// ```
/// use janetrs::{client::JanetClient, Janet};
/// use janetrs::{Janet, client::JanetClient};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let client = JanetClient::init_with_default_env()?;
///
Expand Down Expand Up @@ -314,7 +314,7 @@ impl JanetClient {
///
/// # Examples
/// ```
/// use janetrs::{client::JanetClient, Janet};
/// use janetrs::{Janet, client::JanetClient};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let client = JanetClient::init_with_default_env()?;
///
Expand Down
4 changes: 2 additions & 2 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use core::{ffi::CStr, ptr};
use alloc::{format, string::String};

use crate::{
function::JanetRawCFunction, Janet, JanetBuffer, JanetKeyword, JanetString, JanetSymbol,
JanetTable,
Janet, JanetBuffer, JanetKeyword, JanetString, JanetSymbol, JanetTable,
function::JanetRawCFunction,
};

/// Representation of the Janet runtime environment, like global definitions, available
Expand Down
14 changes: 7 additions & 7 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! - `'data` is the lifetime of data that is owned by the Janet GC.
use core::{
cmp::Ordering,
ffi::{c_char, CStr},
ffi::{CStr, c_char},
fmt::{self, Display, Write},
};

Expand Down Expand Up @@ -1956,7 +1956,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs};
/// use janetrs::{Janet, JanetArgs, janet_fn};
///
/// // Lets say it's a function that if receives an argument, if is not the wanted type, it
/// // defaults to the given value.
Expand All @@ -1981,7 +1981,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs};
/// use janetrs::{Janet, JanetArgs, janet_fn};
///
/// // Lets say it's a function that if receives an argument, if is not the wanted type, it
/// // defaults to the given value.
Expand All @@ -2008,7 +2008,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs};
/// use janetrs::{Janet, JanetArgs, janet_fn};
///
/// // Lets say it's a function that if receives an argument, if is not the wanted type, it
/// // defaults to the given value.
Expand All @@ -2035,7 +2035,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs};
/// use janetrs::{Janet, JanetArgs, janet_fn};
///
/// // Lets say it's a function that if receives an argument, if is not the wanted type, it
/// // defaults to the given value.
Expand Down Expand Up @@ -2065,7 +2065,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs};
/// use janetrs::{Janet, JanetArgs, janet_fn};
///
/// // Lets say it's a function that receives a second argument that change de behavior of
/// // the function
Expand Down Expand Up @@ -2106,7 +2106,7 @@ pub trait JanetArgs {
/// # Examples
///
/// ```
/// use janetrs::{janet_fn, Janet, JanetArgs, JanetString};
/// use janetrs::{Janet, JanetArgs, JanetString, janet_fn};
///
/// #[janet_fn(arity(fix(1)))]
/// fn my_func(args: &mut [Janet]) -> Janet {
Expand Down
4 changes: 2 additions & 2 deletions src/types/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use std::{
io::{self, Write},
};

use evil_janet::{janet_pcall, JanetFunction as CJanetFunction};
use evil_janet::{JanetFunction as CJanetFunction, janet_pcall};

use crate::{cjvg, Janet, JanetFiber, JanetSignal};
use crate::{Janet, JanetFiber, JanetSignal, cjvg};

#[cjvg("1.12.2")]
pub use trystate::JanetTryState;
Expand Down
Loading

0 comments on commit 9aea46a

Please sign in to comment.