docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0122: file include failed

include_str! / include_bytes! take one string path, relative to the file, of a file that can be read.

nabi
let s = include_str!("missing.txt");
error[E0122]: `include_str!` cannot read "missing.txt": no such file
  --> main.nabi:1:9
   |
 1 | let s = include_str!("missing.txt");
   |         ^^^^^^^^^^^

Create missing.txt next to main.nabi, or fix the path. The path is relative to the file that has the include_str!.

Related: E0125 cannot read or write a file

Found a mistake? Edit this page on GitHub. Last updated