File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 33use 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
77pub 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 ) ) ;
Original file line number Diff line number Diff 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 > ( ) ;
You can’t perform that action at this time.
0 commit comments