mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
update comments
This commit is contained in:
parent
7d837c552b
commit
a0827e0425
1 changed files with 3 additions and 1 deletions
|
|
@ -34,10 +34,12 @@ impl Meta {
|
|||
// Constructors
|
||||
|
||||
/// Create new `Self` from UTF-8 buffer
|
||||
/// * supports entire response or just meta slice
|
||||
pub fn from_utf8(buffer: &[u8]) -> Result<Self, (Error, Option<&str>)> {
|
||||
// Calculate buffer length once
|
||||
let len = buffer.len();
|
||||
|
||||
// Can parse from entire response or just meta buffer given
|
||||
// Parse meta bytes only
|
||||
match buffer.get(..if len > MAX_LEN { MAX_LEN } else { len }) {
|
||||
Some(slice) => {
|
||||
// Parse data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue