dag: switch from bytes to minibytes

Summary: The APIs are compatible so the switch is straightforward.

Reviewed By: DurhamG

Differential Revision: D19818713

fbshipit-source-id: 504e9149567c90eb661804e0dad20580a401aa76
This commit is contained in:
Jun Wu 2020-02-28 09:19:41 -08:00 committed by Facebook Github Bot
parent 9e3920ca1c
commit 76ab726056
3 changed files with 7 additions and 3 deletions

View File

@ -5,13 +5,13 @@ edition = "2018"
[dependencies]
indexedlog = { path = "../indexedlog" }
minibytes = { path = "../minibytes" }
types = { path = "../types" }
vlqencoding = { path = "../vlqencoding" }
anyhow = "1.0.20"
bitflags = "1"
byteorder = "1.2.7"
bytes = { version = "0.5", features = ["serde"] }
fs2 = "0.4.3"
indexmap = "1.0.1"
serde = { version = "1", features = ["derive"] }

View File

@ -9,7 +9,7 @@
//!
//! Defines types around [`Id`].
pub use bytes::Bytes;
pub use minibytes::Bytes;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::ops;

View File

@ -51,7 +51,11 @@ pub(crate) fn render_string_with_order(
let mut last_head = 0;
for head in heads.iter() {
id_map
.assign_head(head.as_bytes().into(), &parents_by_name, Group::MASTER)
.assign_head(
head.as_bytes().to_vec().into(),
&parents_by_name,
Group::MASTER,
)
.expect("can assign head");
let Id(head_id) = id_map.find_id_by_name(head.as_bytes()).unwrap().unwrap();
last_head = head_id;