chore: Remove unused imports
- Remove 'os' import from heromodels - Remove 'json' and 'x.json2' imports from openrpc - Remove 'console' import from openrpc - Remove unused imports in multiple modules
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
module heromodels
|
||||
|
||||
import freeflowuniverse.herolib.hero.heroserver
|
||||
import os
|
||||
|
||||
// Start heromodels server using heroserver
|
||||
@[params]
|
||||
|
||||
@@ -4,7 +4,6 @@ import json
|
||||
import net.http
|
||||
import veb
|
||||
import freeflowuniverse.herolib.schemas.jsonrpc
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
@['/auth/:action']
|
||||
pub fn (mut server HeroServer) auth_handler(mut ctx Context, action string) !veb.Result {
|
||||
|
||||
@@ -103,7 +103,7 @@ pub fn (pw Procedure[T, U]) handle(request Request) !Response {
|
||||
data: '${request.params}'
|
||||
}
|
||||
}
|
||||
result := pw.function(payload) or {
|
||||
_ := pw.function(payload) or {
|
||||
return RPCError{
|
||||
code: -32603
|
||||
message: 'Error in function on rpc request.'
|
||||
@@ -115,7 +115,7 @@ pub fn (pw Procedure[T, U]) handle(request Request) !Response {
|
||||
|
||||
pub fn (pw ProcedureVoid[T]) handle(request Request) !Response {
|
||||
payload := decode_payload[T](request.params) or { return invalid_params }
|
||||
result := pw.function(payload) or {
|
||||
_ := pw.function(payload) or {
|
||||
return RPCError{
|
||||
code: -32603
|
||||
message: 'Error in function on rpc request.'
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
module openrpc
|
||||
|
||||
import json
|
||||
import x.json2
|
||||
import freeflowuniverse.herolib.schemas.jsonschema
|
||||
|
||||
// In Method struct
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module openrpc
|
||||
|
||||
import json
|
||||
import x.json2
|
||||
|
||||
// encode encodes an OpenRPC document struct into json string.
|
||||
// eliminates undefined variable by calling prune on the initial encoding.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module openrpc
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
@[params]
|
||||
pub struct Params {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
module openrpc
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
// path to openrpc.json file
|
||||
pub fn new_handler(openrpc_path string) !Handler {
|
||||
mut openrpc_handler := Handler{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module openrpc
|
||||
|
||||
import x.json2 as json { Any }
|
||||
import freeflowuniverse.herolib.schemas.jsonschema { Reference, SchemaRef }
|
||||
|
||||
// This is the root object of the OpenRPC document.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
module openrpc
|
||||
|
||||
import json
|
||||
import x.json2
|
||||
import net.unix
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
Reference in New Issue
Block a user