Skip to content

Commit e374c13

Browse files
authored
small adjustments (#125)
1 parent 9ae028a commit e374c13

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

volga-di/src/container.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ where
3737
T: Inject + 'static,
3838
{
3939
Arc::new(move |c: &Container| -> Result<ArcService, Error> {
40-
T::inject(c)
41-
.map(|t| Arc::new(t) as ArcService)
40+
T::inject(c).map(|t| Arc::new(t) as ArcService)
4241
})
4342
}
4443

volga-di/src/container/factory.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
use super::Error;
44

55
/// A trait that describes a generic factory function
6-
/// that can resolve objects registered in DI container
6+
/// that can resolve objects registered in a DI container
77
pub trait GenericFactory<Args>: Send + Sync + 'static {
88
/// A type of object that will be resolved
99
type Output;
1010

11-
/// Calls a generic function and returns either resolved object or error
11+
/// Calls a generic function and returns either a resolved object or error
1212
fn call(&self, args: Args) -> Result<Self::Output, Error>;
1313
}
1414

@@ -86,7 +86,7 @@ mod tests {
8686
assert_eq!(point.1.0, 2);
8787
}
8888

89-
#[test]
89+
#[test]
9090
fn it_resolves_from_container() {
9191
let mut container = ContainerBuilder::new();
9292
container.register_transient_factory(|| X(1));

volga-di/src/inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ mod tests {
264264
fn it_tests_send_sync_requirements() {
265265
fn assert_send_sync<T: Send + Sync>() {}
266266

267-
// These should compile without issues due to the Send + Sync bounds
267+
// These should compile without issues due to the Send and Sync bounds
268268
assert_send_sync::<SimpleService>();
269269
assert_send_sync::<ServiceWithDependency>();
270270
assert_send_sync::<ComplexService>();

0 commit comments

Comments
 (0)