rustlings/src/dev/check.rs

17 lines
352 B
Rust
Raw Normal View History

2024-04-15 21:30:28 -04:00
use std::fs;
2024-04-15 17:54:57 -04:00
2024-04-15 21:30:28 -04:00
use anyhow::{Context, Result};
use crate::{info_file::InfoFile, init::cargo_toml};
pub fn check(info_file: InfoFile) -> Result<()> {
// TODO: Add checks
fs::write("Cargo.toml", cargo_toml(&info_file.exercises))
.context("Failed to update the file `Cargo.toml`")?;
println!("Everything looks fine!");
Ok(())
2024-04-15 17:54:57 -04:00
}