Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Implement From<&str> on Atom #125

Merged
merged 2 commits into from Jul 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions appveyor.yml
@@ -1,14 +1,17 @@
environment:
matrix:
- RUST: 1.6.0
- RUST: stable
BITS: 32
- RUST: 1.6.0
- RUST: stable
BITS: 64

install:
- IF "%BITS%" == "32" SET ARCH=i686
- IF "%BITS%" == "64" SET ARCH=x86_64
- SET RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%ARCH%-pc-windows-gnu.exe
- ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable"
- ps: $env:RUST_VERSION = Get-Content channel-rust-stable | select -first 1 | %{$_.split('-')[1]}
- if NOT "%RUST%" == "stable" set RUST_VERSION=%RUST%
- SET RUST_URL=https://static.rust-lang.org/dist/rust-%RUST_VERSION%-%ARCH%-pc-windows-gnu.exe
- SET PATH=C:\Rust\bin;C:\msys64\mingw%BITS%\bin;%PATH%;C:\msys64\usr\bin
- ps: Start-FileDownload $Env:RUST_URL -FileName rust-dist.exe
- rust-dist.exe /VERYSILENT /NORESTART /COMPONENTS="Rustc,Gcc,Cargo,Std" /DIR="C:\Rust"
Expand Down
7 changes: 7 additions & 0 deletions src/atom.rs
Expand Up @@ -36,3 +36,10 @@ impl FromGlibPtr<ffi::GdkAtom> for Atom {
#[inline]
unsafe fn from_glib_full(_: ffi::GdkAtom) -> Atom { unimplemented!() }
}

impl<'a> From<&'a str> for Atom {
fn from(r: &'a str) -> Atom {
skip_assert_initialized!();
Atom::intern(r)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip_assert_initialized!(); ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want it to be checked?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose since intern checks that, it can be skipped here.

}
}