♻️ Use simpler syntax to bind Node instance
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 27 Oct 2019 16:31:51 +0000 (17:31 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 27 Oct 2019 16:31:51 +0000 (17:31 +0100)
src/main/kotlin/net/pterodactylus/sone/main/FreenetModule.kt

index 9fff176..fe3b3af 100644 (file)
@@ -16,7 +16,7 @@ class FreenetModule(private val pluginRespirator: PluginRespirator) : Module {
 
        override fun configure(binder: Binder): Unit = binder.run {
                bind(PluginRespiratorFacade::class.java).toProvider(Provider { FredPluginRespiratorFacade(pluginRespirator) }).`in`(Singleton::class.java)
-               pluginRespirator.node!!.let { node -> bind(Node::class.java).toProvider(Provider<Node> { node }) }
+               bind(Node::class.java).toProvider(Provider { pluginRespirator.node })
                bind(HighLevelSimpleClient::class.java).toProvider(Provider<HighLevelSimpleClient> { pluginRespirator.hlSimpleClient!! })
                bind(ToadletContainer::class.java).toProvider(Provider<ToadletContainer> { pluginRespirator.toadletContainer })
                bind(PageMaker::class.java).toProvider(Provider<PageMaker> { pluginRespirator.pageMaker })