We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62b6642 commit ac888d3Copy full SHA for ac888d3
packages/check/src/main.rs
@@ -1,6 +1,7 @@
1
use std::collections::HashSet;
2
use std::fs::File;
3
use std::io::Read;
4
+use std::path::Path;
5
use std::process::exit;
6
7
use clap::{Arg, ArgAction, Command};
@@ -104,7 +105,12 @@ fn check_contract(
104
105
let mut wasm = Vec::<u8>::new();
106
file.read_to_end(&mut wasm)?;
107
- let prefix = format!("{}: ", path);
108
+ // Potentially lossy filename or path as used as a short prefix for the output
109
+ let filename_identifier: String = Path::new(path)
110
+ .file_name()
111
+ .map(|f| String::from_utf8_lossy(f.as_encoded_bytes()).to_string())
112
+ .unwrap_or(path.to_string());
113
+ let prefix = format!(" {}: ", filename_identifier);
114
let logs = if verbose {
115
Logger::On {
116
prefix: &prefix,
0 commit comments