这是一个以前从来没有发生过的问题,在我添加了Excel函数后突然出现了
use crate::common::offic::excel; // <<--
use clap::Parser;
use jni::objects::*;
use jni::JNIEnv;
use std::path::Path;
use HspiceCompiler::hspice::spice; // <<--
#[derive(Parser, Debug)]
#[command(author, version, about)]
pub struct Args {
#[clap(help = "Hspice file name")]
pub file_name: String,
#[clap(short, long)]
pub output_path: String,
}
fn main() {
let args = Args::parse();
let spice_file = Path::new(&args.file_name);
let output_path = Path::new(&args.output_path);
loading(args);
spice_file.try_exists().expect("Can't access hspice file");
let mut reader = spice::Reader::new();
let data_iter = reader.read(spice_file);
reader.analysis_iter(data_iter);
excel::write_to_excel(data_iter, output_path);
}
fn loading(args: Args) {
...
}
错误:
error[E0433]: failed to resolve: could not find `common` in the crate root
--> src/bin/run.rs:1:12
|
1 | use crate::common::offic::excel;
| ^^^^^^ could not find `common` in the crate root
error[E0433]: failed to resolve: use of undeclared type `HspiceCompiler`
--> src/bin/run.rs:5:5
|
5 | use HspiceCompiler::common::offic::excel;
| ^^^^^^^^^^^^^^ use of undeclared type `HspiceCompiler`
我的GitHub->;Run.RS:https://github.com/llllishuo/menghan_Hspice_Compiler/blob/main/src/bin/run.rs