Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cairo/src/surface_png.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ impl Surface {

#[cfg(test)]
mod tests {
use std::io::ErrorKind;

use super::*;
use crate::enums::Format;

Expand All @@ -162,7 +160,7 @@ mod tests {
// A reader that always returns an error
impl Read for IoErrorReader {
fn read(&mut self, _: &mut [u8]) -> Result<usize, io::Error> {
Err(io::Error::new(ErrorKind::Other, "yikes!"))
Err(io::Error::other("yikes!"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion gio/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl From<IOErrorEnum> for io::ErrorKind {
pub(crate) fn to_std_io_result<T>(result: Result<T, glib::Error>) -> io::Result<T> {
result.map_err(|g_error| match g_error.kind::<IOErrorEnum>() {
Some(io_error_enum) => io::Error::new(io_error_enum.into(), g_error),
None => io::Error::new(io::ErrorKind::Other, g_error),
None => io::Error::other(g_error),
})
}

Expand Down
7 changes: 2 additions & 5 deletions gio/src/read_input_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,11 @@ impl AnyReader {
Ok(res) => res,
Err(panic) => {
self.reader = AnyOrPanic::Panic(panic);
Err(std::io::Error::new(std::io::ErrorKind::Other, "Panicked"))
Err(std::io::Error::other("Panicked"))
}
}
}
AnyOrPanic::Panic(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Panicked before",
)),
AnyOrPanic::Panic(_) => Err(std::io::Error::other("Panicked before")),
}
}

Expand Down
7 changes: 2 additions & 5 deletions gio/src/write_output_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,11 @@ impl AnyWriter {
Ok(res) => res,
Err(panic) => {
self.writer = AnyOrPanic::Panic(panic);
Err(std::io::Error::new(std::io::ErrorKind::Other, "Panicked"))
Err(std::io::Error::other("Panicked"))
}
}
}
AnyOrPanic::Panic(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Panicked before",
)),
AnyOrPanic::Panic(_) => Err(std::io::Error::other("Panicked before")),
}
}

Expand Down
3 changes: 2 additions & 1 deletion glib/benches/gstring.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};
use glib::IntoGStr;
use std::hint::black_box;

pub fn str_into_gstr(c: &mut Criterion) {
c.bench_function("str as IntoGStr", |b| {
Expand Down
Loading
Loading