programs: remove superfluous type ascription

reviewable/pr1393/r4
Tamir Duberstein 6 days ago
parent 14a844256a
commit 1791d497d3
No known key found for this signature in database

@ -324,7 +324,7 @@ fn read_sys_fs_perf_type(pmu: &str) -> Result<u32, (PathBuf, io::Error)> {
.join("type"); .join("type");
fs::read_to_string(&file) fs::read_to_string(&file)
.and_then(|perf_ty| perf_ty.trim().parse::<u32>().map_err(io::Error::other)) .and_then(|perf_ty| perf_ty.trim().parse().map_err(io::Error::other))
.map_err(|e| (file, e)) .map_err(|e| (file, e))
} }
@ -340,7 +340,7 @@ fn read_sys_fs_perf_ret_probe(pmu: &str) -> Result<u32, (PathBuf, io::Error)> {
.next() .next()
.ok_or_else(|| io::Error::other("invalid format"))?; .ok_or_else(|| io::Error::other("invalid format"))?;
config.parse::<u32>().map_err(io::Error::other) config.parse().map_err(io::Error::other)
}) })
.map_err(|e| (file, e)) .map_err(|e| (file, e))
} }

@ -122,7 +122,7 @@ pub(crate) fn read_sys_fs_trace_point_id(
Ok(id) => id, Ok(id) => id,
Err(io_error) => return Err(TracePointError::FileError { filename, io_error }), Err(io_error) => return Err(TracePointError::FileError { filename, io_error }),
}; };
let id = match id.trim().parse::<u32>() { let id = match id.trim().parse() {
Ok(id) => id, Ok(id) => id,
Err(error) => { Err(error) => {
return Err(TracePointError::FileError { return Err(TracePointError::FileError {

Loading…
Cancel
Save