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:
Mahmoud-Emad
2025-09-28 10:38:45 +03:00
parent 78f7d3a8c4
commit 61487902d6
9 changed files with 2 additions and 14 deletions

View File

@@ -1,7 +1,6 @@
module heromodels
import freeflowuniverse.herolib.hero.heroserver
import os
// Start heromodels server using heroserver
@[params]

View File

@@ -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 {

View File

@@ -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.'

View File

@@ -1,7 +1,5 @@
module openrpc
import json
import x.json2
import freeflowuniverse.herolib.schemas.jsonschema
// In Method struct

View File

@@ -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.

View File

@@ -1,7 +1,6 @@
module openrpc
import os
import json
@[params]
pub struct Params {

View File

@@ -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{

View File

@@ -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.

View File

@@ -1,7 +1,5 @@
module openrpc
import json
import x.json2
import net.unix
import os
import freeflowuniverse.herolib.ui.console