mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
Convert scm/hg/lib/bookmarkstore to Rust 2018
Summary: Rust 2018 updates to: //scm/hg/lib/bookmarkstore:bookmarkstore //scm/hg/lib/bookmarkstore:bookmarkstore-unittest Reviewed By: xavierd Differential Revision: D15465461 fbshipit-source-id: 01d1b68c82e7d185a8235c94321f86a7937738a5
This commit is contained in:
parent
272b20b443
commit
70a5636b92
@ -6,7 +6,6 @@
|
||||
//!
|
||||
//! Bookmarks can be loaded from an existing hg bookmarks file.
|
||||
|
||||
extern crate atomicwrites;
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
extern crate indexedlog;
|
||||
@ -154,7 +153,7 @@ enum BookmarkEntry<'a> {
|
||||
}
|
||||
|
||||
impl<'a> BookmarkEntry<'a> {
|
||||
fn pack(bookmark_entry: &BookmarkEntry) -> Vec<u8> {
|
||||
fn pack(bookmark_entry: &BookmarkEntry<'_>) -> Vec<u8> {
|
||||
let mut result = Vec::new();
|
||||
match bookmark_entry {
|
||||
BookmarkEntry::Remove { bookmark } => {
|
||||
@ -170,7 +169,7 @@ impl<'a> BookmarkEntry<'a> {
|
||||
result
|
||||
}
|
||||
|
||||
fn unpack(data: &[u8]) -> BookmarkEntry {
|
||||
fn unpack(data: &[u8]) -> BookmarkEntry<'_> {
|
||||
match data[0] {
|
||||
b'R' => {
|
||||
let bookmark = str::from_utf8(&data[1..]).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user