mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-11 23:06:54 +00:00
fix clippy warnings on util and rpc
This commit is contained in:
committed by
Alex Auvolat
parent
88925ebe22
commit
f05bb111c2
+1
-1
@@ -72,7 +72,7 @@ impl FixedBytes32 {
|
||||
&mut self.0[..]
|
||||
}
|
||||
/// Copy to a slice
|
||||
pub fn to_vec(&self) -> Vec<u8> {
|
||||
pub fn to_vec(self) -> Vec<u8> {
|
||||
self.0.to_vec()
|
||||
}
|
||||
/// Try building a FixedBytes32 from a slice
|
||||
|
||||
+2
-2
@@ -93,12 +93,12 @@ impl From<sled::transaction::TransactionError<Error>> for Error {
|
||||
|
||||
impl<T> From<tokio::sync::watch::error::SendError<T>> for Error {
|
||||
fn from(_e: tokio::sync::watch::error::SendError<T>) -> Error {
|
||||
Error::Message(format!("Watch send error"))
|
||||
Error::Message("Watch send error".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<tokio::sync::mpsc::error::SendError<T>> for Error {
|
||||
fn from(_e: tokio::sync::mpsc::error::SendError<T>) -> Error {
|
||||
Error::Message(format!("MPSC send error"))
|
||||
Error::Message("MPSC send error".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
//! Crate containing common functions and types used in Garage
|
||||
|
||||
#[macro_use]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::io::{Read, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
@@ -18,8 +18,8 @@ impl<T> Persister<T>
|
||||
where
|
||||
T: Serialize + for<'de> Deserialize<'de>,
|
||||
{
|
||||
pub fn new(base_dir: &PathBuf, file_name: &str) -> Self {
|
||||
let mut path = base_dir.clone();
|
||||
pub fn new(base_dir: &Path, file_name: &str) -> Self {
|
||||
let mut path = base_dir.to_path_buf();
|
||||
path.push(file_name);
|
||||
Self {
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user