/// `ExpectedVersion` represents the different modes of optimistic locking when writing to a stream
/// using `WriteEventsBuilder`.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ExpectedVersion {
    /// No optimistic locking
    Any,
    /// Expect a stream not to exist
    NoStream,
    /// Expect exact number of events in the stream
    Exact(u32)
}

impl From<ExpectedVersion> for i32 {
    /// Returns the wire representation.
    fn from(version: ExpectedVersion) -> Self {
        use self::ExpectedVersion::*;
        match version {
            Any => -2,
            NoStream => -1,
            Exact(ver) => ver as i32
        }
    }
}

/// `ExpectedVersion` represents the different modes of optimistic locking when writing to a stream
/// using `WriteEventsBuilder`.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ExpectedVersion {
    /// No optimistic locking
    Any,
    /// Expect a stream not to exist
    NoStream,
    /// Expect exact number of events in the stream
    Exact(u32)
}

impl Into<i32> for ExpectedVersion {
    /// Returns the wire representation.
    fn into(self) -> i32 {
        use self::ExpectedVersion::*;
        match self {
            Any => -2,
            NoStream => -1,
            Exact(ver) => ver as i32
        }
    }
}

--- 
+++ 
@@ -10,11 +10,11 @@
     Exact(u32)
 }
 
-impl Into<i32> for ExpectedVersion {
+impl From<ExpectedVersion> for i32 {
     /// Returns the wire representation.
-    fn into(self) -> i32 {
+    fn from(version: ExpectedVersion) -> Self {
         use self::ExpectedVersion::*;
-        match self {
+        match version {
             Any => -2,
             NoStream => -1,
             Exact(ver) => ver as i32
expected-version: Replace the Into impl by a From impl
