diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-04-06 11:32:42 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-04-06 11:34:25 +0200 |
commit | 774a9c331214fc6682c793eb5cf8d666f8774b57 (patch) | |
tree | 1bdf96b747c73b608fe2bd925458406931558df4 /librepology/src/v1/buffer.rs | |
parent | 4f65f82b5d5f288a66f99150ce58b793076da061 (diff) |
Run cargo-fmt
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'librepology/src/v1/buffer.rs')
-rw-r--r-- | librepology/src/v1/buffer.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/librepology/src/v1/buffer.rs b/librepology/src/v1/buffer.rs index 534ab4c..e2eb67a 100644 --- a/librepology/src/v1/buffer.rs +++ b/librepology/src/v1/buffer.rs @@ -1,20 +1,20 @@ use std::io::Read; -use crate::v1::error::Result; +use crate::v1::api::Api; use crate::v1::error::RepologyError as Error; -use crate::v1::types::Problem; +use crate::v1::error::Result; use crate::v1::types::Package; -use crate::v1::api::Api; +use crate::v1::types::Problem; #[derive(Debug)] pub struct BufferApi { buf: String, } -impl BufferApi -{ +impl BufferApi { pub fn read_from<R>(mut input: R) -> Result<BufferApi> - where R: Read, + where + R: Read, { let mut buf = String::new(); let read = input.read_to_string(&mut buf)?; @@ -24,7 +24,6 @@ impl BufferApi } impl Api for BufferApi { - fn project<N: AsRef<str>>(&self, _name: N) -> Result<Vec<Package>> { serde_json::de::from_str(&self.buf).map_err(Error::from) } @@ -36,6 +35,4 @@ impl Api for BufferApi { fn problems_for_maintainer<M: AsRef<str>>(&self, _maintainer: M) -> Result<Vec<Problem>> { serde_json::de::from_str(&self.buf).map_err(Error::from) } - } - |