Skip to content

Commit 8887501

Browse files
committed
Rename trait
1 parent aa2aa82 commit 8887501

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/definition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use rquickjs::{
5858
/// }
5959
/// }
6060
/// ```
61-
pub trait ModuleDefExt<O = ()> {
61+
pub trait Extension<O = ()> {
6262
type Implementation: ModuleImplementationType<O>;
6363

6464
fn globals(_globals: &Object<'_>, _options: &O) -> Result<()> {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! [`ModuleDef`](rquickjs::module::ModuleDef)
88
//! that would allow it to have options as input and set global.
99
10-
pub use self::definition::{GlobalsOnly, ModuleDefExt, ModuleImpl};
10+
pub use self::definition::{Extension, GlobalsOnly, ModuleImpl};
1111
pub use self::loader::{GlobalInitializer, ModuleLoader, ModuleLoaderBuilder, ModuleResolver};
1212

1313
mod definition;

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[macro_export]
22
macro_rules! globals_only_module {
33
($name:ident, |$globals:ident| { $($t:tt)* }) => {
4-
impl ModuleDefExt for $name {
4+
impl Extension for $name {
55
type Implementation = GlobalsOnly;
66

77
fn globals(globals: &Object<'_>, _options: &()) -> Result<()> {

src/wrapper/globals.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use rquickjs::{
44
};
55

66
use super::{IntoModule, ModuleMeta};
7-
use crate::{GlobalsOnly, ModuleDefExt};
7+
use crate::{GlobalsOnly, Extension};
88

99
pub struct GlobalDefWrapper<T, O>
1010
where
11-
T: ModuleDefExt<O, Implementation = GlobalsOnly>,
11+
T: Extension<O, Implementation = GlobalsOnly>,
1212
for<'js> O: JsLifetime<'js>,
1313
{
1414
_marker: std::marker::PhantomData<T>,
@@ -17,14 +17,14 @@ where
1717

1818
impl<T, O> IntoModule<O, GlobalDefWrapper<T, O>> for T
1919
where
20-
T: ModuleDefExt<O, Implementation = GlobalsOnly>,
20+
T: Extension<O, Implementation = GlobalsOnly>,
2121
for<'js> O: JsLifetime<'js>,
2222
{
2323
}
2424

2525
impl<T, O> ModuleMeta for GlobalDefWrapper<T, O>
2626
where
27-
T: ModuleDefExt<O, Implementation = GlobalsOnly>,
27+
T: Extension<O, Implementation = GlobalsOnly>,
2828
for<'js> O: JsLifetime<'js>,
2929
{
3030
fn name() -> &'static str {
@@ -40,7 +40,7 @@ where
4040

4141
impl<T, O> ModuleDef for GlobalDefWrapper<T, O>
4242
where
43-
T: ModuleDefExt<O, Implementation = GlobalsOnly>,
43+
T: Extension<O, Implementation = GlobalsOnly>,
4444
for<'js> O: JsLifetime<'js>,
4545
{
4646
//unused

src/wrapper/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rquickjs::{module::ModuleDef, JsLifetime};
22

3-
use crate::ModuleDefExt;
3+
use crate::Extension;
44

55
mod globals;
66
mod module;
@@ -19,7 +19,7 @@ pub trait ModuleMeta {
1919
/// Semantically convert a [`ModuleDefExt`] to a [`ModuleDef`] and [`ModuleMeta`]
2020
pub trait IntoModule<O, R>
2121
where
22-
Self: ModuleDefExt<O>,
22+
Self: Extension<O>,
2323
R: ModuleDef + ModuleMeta,
2424
for<'js> O: JsLifetime<'js>,
2525
{

src/wrapper/module.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use rquickjs::{
44
};
55

66
use super::{IntoModule, ModuleMeta};
7-
use crate::{ModuleDefExt, ModuleImpl};
7+
use crate::{Extension, ModuleImpl};
88

99
pub struct ModuleDefWrapper<T, O>
1010
where
11-
T: ModuleDefExt<O, Implementation = ModuleImpl<O>>,
11+
T: Extension<O, Implementation = ModuleImpl<O>>,
1212
for<'js> O: JsLifetime<'js>,
1313
{
1414
_marker: std::marker::PhantomData<T>,
@@ -17,14 +17,14 @@ where
1717

1818
impl<T, O> IntoModule<O, ModuleDefWrapper<T, O>> for T
1919
where
20-
T: ModuleDefExt<O, Implementation = ModuleImpl<O>>,
20+
T: Extension<O, Implementation = ModuleImpl<O>>,
2121
for<'js> O: JsLifetime<'js> + 'static,
2222
{
2323
}
2424

2525
impl<T, O> ModuleMeta for ModuleDefWrapper<T, O>
2626
where
27-
T: ModuleDefExt<O, Implementation = ModuleImpl<O>>,
27+
T: Extension<O, Implementation = ModuleImpl<O>>,
2828
for<'c> O: JsLifetime<'c> + 'static,
2929
{
3030
fn name() -> &'static str {
@@ -38,7 +38,7 @@ where
3838

3939
impl<T, O> ModuleDef for ModuleDefWrapper<T, O>
4040
where
41-
T: ModuleDefExt<O, Implementation = ModuleImpl<O>>,
41+
T: Extension<O, Implementation = ModuleImpl<O>>,
4242
for<'js> O: JsLifetime<'js> + 'static,
4343
{
4444
fn declare(decl: &Declarations) -> Result<()> {

0 commit comments

Comments
 (0)