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.
std::io::Error::new(ErrorKind::Other, ...)
std::io::Error::other
1 parent b6fc80d commit f690158Copy full SHA for f690158
src/builder/create_attachment.rs
@@ -49,12 +49,10 @@ impl CreateAttachment {
49
let mut data = Vec::new();
50
file.read_to_end(&mut data).await?;
51
52
- let filename = path.as_ref().file_name().ok_or_else(|| {
53
- std::io::Error::new(
54
- std::io::ErrorKind::Other,
55
- "attachment path must not be a directory",
56
- )
57
- })?;
+ let filename = path
+ .as_ref()
+ .file_name()
+ .ok_or_else(|| std::io::Error::other("attachment path must not be a directory"))?;
58
59
Ok(CreateAttachment::bytes(data, filename.to_string_lossy().to_string()))
60
}
0 commit comments