Skip to content

error[E0425]: cannot find function xlsx_row_value in this scope #140760

Closed
@AveNRU

Description

@AveNRU

I tried this code:

<code>
use crate::lib_1::{self, Dictionary};
//загрузка словаря
pub fn import_dictionary(dictionary_path_vec:&Vec<String>) ->Vec<lib_1::Dictionary> {
    use calamine::{open_workbook, Data, Reader, Xlsx};
    //итоговая стопка
    let mut _dictionary_vec:Vec<lib_1::Dictionary> =Vec::new();
    for i in 0..dictionary_path_vec.len() {
        //пустая стопка
    let mut _dictionary:lib_1::Dictionary=Dictionary{
        path:dictionary_path_vec[i].clone(),//путь
        ..Default::default()
    };
    //начало
    let mut workbook: Xlsx<_> =
    open_workbook(&dictionary_path_vec[i]).expect("Не могу открыть файл .xlsx в папке ./allegro/config");
    let name_vec_sheets= workbook.sheet_names();
    //чтение содержимого всех страниц
    for j in 0..name_vec_sheets.len() {
        //вектор слов
        let mut _words_1_vec:Vec<String>=Vec::new();
        //вектор замен
        let mut _words_2_vec:Vec<String>=Vec::new();
        //получение имени страницы
    let name_list = name_vec_sheets[j].clone(); //имя главной страницы
    //открытие страницы книги
    let main_list: Result<calamine::Range<Data>, calamine::XlsxError> =
        workbook.worksheet_range(&name_list); 
        let main_words: calamine::Range<Data> =
        main_list.expect("не получилось открыть главную страницу в файле .xlsx ");
        let last_row = main_words.get_size().0;
        for k in 0..last_row {
            let refdes_str = xlsx_row_value(, i, 0);
            let word_1=xlsx_row_value(&main_words, k, 0);
            let word_2=xlsx_row_value(&main_words, k, 1);
        }

    }
    //
    
    //вложение в общую стопку
    _dictionary_vec.push(_dictionary);
}
    return _dictionary_vec
}


cargo.toml

[package]
name = "replace_all"
version = "0.1.0"
edition = "2024"

[dependencies]
lazy_static = "1.5.0"
regex = "1.11.1"
calamine = "0.27.0"
rust_xlsxwriter = "0.86.1"
encoding_rs = "0.8.35"
encoding_rs_io = "0.1.7"
rtf-parser = "0.4.2"
#доп

anyhow = "1.0.98"
clap = "4.5.37"
docx-rs = "0.4.17"
serde_json = "1.0.140"

I expected to see this happen: explanation

Instead, this happened: explanation

Meta

rustc --version --verbose:

stable-x86_64-pc-windows-msvc unchanged - rustc 1.86.0 (05f9846f8 2025-03-31)
Backtrace

<backtrace>

error[E0425]: cannot find function `xlsx_row_value` in this scope
  --> src\import_xls.rs:32:30
   |
32 |             let refdes_str = xlsx_row_value(&main_list, i, 0);
   |                              ^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `xlsx_row_value` in this scope
  --> src\import_xls.rs:33:24
   |
33 |             let word_1=xlsx_row_value(&main_words, k, 0);
   |                        ^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `xlsx_row_value` in this scope
  --> src\import_xls.rs:34:24
   |
34 |             let word_2=xlsx_row_value(&main_words, k, 1);
   |                        ^^^^^^^^^^^^^^ not found in this scope

![Image](https://github.com/user-attachments/assets/f68bfafd-2576-478c-844d-bb7030b25530)

![Image](https://github.com/user-attachments/assets/7603f081-c9af-4395-98f2-2da1342c8212)

On another my project all is right

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions