mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 17:45:35 +00:00
apply some clippy corrections
This commit is contained in:
parent
d6dc4d6870
commit
1d4dc50380
4 changed files with 18 additions and 21 deletions
|
|
@ -43,7 +43,7 @@ impl Meta {
|
|||
match buffer.get(..if len > MAX_LEN { MAX_LEN } else { len }) {
|
||||
Some(slice) => {
|
||||
// Parse data
|
||||
let data = Data::from_utf8(&slice);
|
||||
let data = Data::from_utf8(slice);
|
||||
|
||||
if let Err(reason) = data {
|
||||
return Err((
|
||||
|
|
@ -57,7 +57,7 @@ impl Meta {
|
|||
|
||||
// MIME
|
||||
|
||||
let mime = Mime::from_utf8(&slice);
|
||||
let mime = Mime::from_utf8(slice);
|
||||
|
||||
if let Err(reason) = mime {
|
||||
return Err((
|
||||
|
|
@ -72,7 +72,7 @@ impl Meta {
|
|||
|
||||
// Status
|
||||
|
||||
let status = Status::from_utf8(&slice);
|
||||
let status = Status::from_utf8(slice);
|
||||
|
||||
if let Err(reason) = status {
|
||||
return Err((
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ impl Data {
|
|||
/// from entire response or just header slice
|
||||
///
|
||||
/// * result could be `None` for some [status codes](https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes)
|
||||
/// that does not expect any data in header
|
||||
/// that does not expect any data in header
|
||||
pub fn from_utf8(buffer: &[u8]) -> Result<Option<Self>, Error> {
|
||||
// Define max buffer length for this method
|
||||
const MAX_LEN: usize = 0x400; // 1024
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ impl Mime {
|
|||
/// Create new `Self` from UTF-8 buffer (that includes **header**)
|
||||
///
|
||||
/// * result could be `None` for some [status codes](https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes)
|
||||
/// that does not expect MIME type in header
|
||||
/// that does not expect MIME type in header
|
||||
/// * includes `Self::from_string` parser,
|
||||
/// it means that given buffer should contain some **header** (not filepath or any other type of strings)
|
||||
/// it means that given buffer should contain some **header** (not filepath or any other type of strings)
|
||||
pub fn from_utf8(buffer: &[u8]) -> Result<Option<Self>, Error> {
|
||||
// Define max buffer length for this method
|
||||
const MAX_LEN: usize = 0x400; // 1024
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue