Skip to content
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

Lowercase mod name to avoid non_snake_case lint #17

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Lowercase mod name to avoid non_snake_case lint
  • Loading branch information
tmandry committed Oct 3, 2024
commit d7d9a519183c6ff4cf70591ce86992fc56254ba6
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/basic-mut.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use dynosaur::dynosaur;
trait MyTrait {
async fn foo(&mut self);
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
fn foo<'life0, 'dynosaur>(&'life0 mut self)
Expand Down Expand Up @@ -65,6 +65,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/basic-no-ret.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use dynosaur::dynosaur;
trait MyTrait {
async fn foo(&self);
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
fn foo<'life0, 'dynosaur>(&'life0 self)
Expand Down Expand Up @@ -65,6 +65,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/basic-rpitit.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait MyTrait {
fn foo(&self)
-> impl Send;
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
fn foo<'life0, 'dynosaur>(&'life0 self)
Expand Down Expand Up @@ -60,6 +60,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/basic-with-self.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait MyTrait {
async fn foo(&self)
-> Self::Item;
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
type Item;
Expand Down Expand Up @@ -79,6 +79,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/basic.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait MyTrait {
async fn foo(&self)
-> i32;
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
fn foo<'life0, 'dynosaur>(&'life0 self)
Expand Down Expand Up @@ -66,6 +66,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/handle-generics-on-trait-def.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait MyTrait<T> {
async fn foo(&self, x: &T)
-> i32;
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait<T> {
const N: i32;
Expand Down Expand Up @@ -85,6 +85,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
4 changes: 2 additions & 2 deletions dynosaur/tests/pass/handle-lifetimes.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait MyTrait {
async fn foo<T>(&self, x: &T)
-> i32;
}
mod _dynosaur_macro_DynMyTrait {
mod _dynosaur_macro_dynmytrait {
use super::*;
trait ErasedMyTrait {
type Item;
Expand Down Expand Up @@ -80,6 +80,6 @@ mod _dynosaur_macro_DynMyTrait {
}
}
}
use _dynosaur_macro_DynMyTrait::DynMyTrait;
use _dynosaur_macro_dynmytrait::DynMyTrait;

fn main() {}
8 changes: 4 additions & 4 deletions dynosaur/tests/pass/trait-variant.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait Next {
async fn next(&mut self)
-> Option<Self::Item>;
}
mod _dynosaur_macro_DynNext {
mod _dynosaur_macro_dynnext {
use super::*;
#[allow(async_fn_in_trait)]
trait ErasedNext {
Expand Down Expand Up @@ -76,13 +76,13 @@ mod _dynosaur_macro_DynNext {
}
}
}
use _dynosaur_macro_DynNext::DynNext;
use _dynosaur_macro_dynnext::DynNext;
trait SendNext: Send {
type Item;
fn next(&mut self)
-> impl ::core::future::Future<Output = Option<Self::Item>> + Send;
}
mod _dynosaur_macro_DynSendNext {
mod _dynosaur_macro_dynsendnext {
use super::*;
trait ErasedSendNext: Send {
type Item;
Expand Down Expand Up @@ -154,7 +154,7 @@ mod _dynosaur_macro_DynSendNext {
}
}
}
use _dynosaur_macro_DynSendNext::DynSendNext;
use _dynosaur_macro_dynsendnext::DynSendNext;
impl<TraitVariantBlanketType: SendNext> Next for TraitVariantBlanketType {
type Item = <Self as SendNext>::Item;
async fn next(&mut self) -> Option<Self::Item> {
Expand Down
5 changes: 4 additions & 1 deletion dynosaur_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ pub fn dynosaur(
let struct_inherent_impl =
mk_struct_inherent_impl(&struct_ident, &item_trait.ident, &erased_trait);
let dynosaur_mod = Ident::new(
&format!("_dynosaur_macro_{}", struct_ident),
&format!(
"_dynosaur_macro_{}",
struct_ident.to_string().to_lowercase(),
),
Span::call_site(),
);

Expand Down
Loading