Skip to content

Add a generic From<&Borrow> impl for Cow #48191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some issues
  • Loading branch information
burtonageo committed Feb 12, 2018
commit a8f5236cf34433fcf36b84aa7d885e58964000b9
6 changes: 3 additions & 3 deletions src/liballoc/tests/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use std::borrow::Cow;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::ffi::{CStr, CString, OSStr, OSString};

#[test]
Expand All @@ -27,8 +27,8 @@ fn test_cow_from() {
assert_eq!(Cow::from(v), Cow::Owned(VALUES.iter().collect::<Vec<_>>()));

let p = PathBuf::new();
assert_eq!(Cow::from(&p), Cow::Borrowed(p.as_path()));
assert_eq!(Cow::from(v.as_path()), Cow::Borrowed(p.as_path()));
assert_eq!(Cow::from(&p), Cow::Borrowed(Path::new("")));
assert_eq!(Cow::from(p.as_path()), Cow::Borrowed(Path::new("")));

let cstring = CString::new(MSG);
let cstr = {
Expand Down