mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 13:14:58 -06:00
demo app, long string print
This commit is contained in:
7
demo/Cargo.toml
Normal file
7
demo/Cargo.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "demo"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
18
demo/build.rs
Normal file
18
demo/build.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::{
|
||||
env,
|
||||
error::Error,
|
||||
fs::File,
|
||||
io::{BufWriter, Write},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let out_dir = env::var("OUT_DIR")?;
|
||||
let dest_path = Path::new(&out_dir).join("long_string.txt");
|
||||
let mut f = BufWriter::new(File::create(&dest_path)?);
|
||||
|
||||
let long_string = "abc".repeat(100);
|
||||
write!(f, "{}", long_string)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
5
demo/src/main.rs
Normal file
5
demo/src/main.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
static LONG_STRING: &'static str = include_str!(concat!(env!("OUT_DIR"), "/long_string.txt"));
|
||||
|
||||
fn main() {
|
||||
println!("This package was compiled at {}", LONG_STRING);
|
||||
}
|
||||
Reference in New Issue
Block a user