diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ca3cdc9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -language: rust -cache: cargo -rust: - - stable - - beta - - nightly -os: linux - -# always test things that aren't pushes (like PRs) -# never test tags or pushes to non-master branches (wait for PR) -# https://github.com/travis-ci/travis-ci/issues/2200#issuecomment-441395545) -if: type != push OR (tag IS blank AND branch = master) - -jobs: - allow_failures: - - rust: nightly - include: - - &check - stage: check # do a pre-screen to make sure this is even worth testing - script: cargo check --all-targets - rust: stable - # <1.32.0 doesn't work because of associated items on type aliases - - <<: *check # also test oldest known-good stable - rust: 1.32.0 - - stage: test - rust: stable - os: osx - - rust: stable - os: windows - - stage: lint # we lint on beta to future-proof - name: "Rust: beta, rustfmt" - rust: beta - script: - - rustup component add rustfmt-preview - - cargo fmt -v -- --check - - name: "Rust: nightly, rustfmt" # and on nightly with allow_fail - rust: nightly - script: - - rustup component add rustfmt-preview - - cargo fmt -v -- --check - - name: "Rust: beta, clippy" - rust: beta - script: - - rustup component add clippy-preview - - touch ./src/lib.rs && cargo clippy -- -D warnings - - name: "Rust: nightly, clippy" - rust: nightly - script: - - rustup component add clippy-preview - - touch ./src/lib.rs && cargo clippy -- -D warnings - - stage: coverage - sudo: required - dist: trusty - cache: false - services: - - docker - script: - - docker run --security-opt seccomp=unconfined -v "$PWD:/volume" xd009642/tarpaulin:latest sh -c "cargo tarpaulin --out Xml" - - bash <(curl -s https://codecov.io/bash) -stages: - - check - - test - - lint - - coverage diff --git a/Cargo.toml b/Cargo.toml index d991677..8bcc89c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ categories = ["api-bindings", "network-programming", "database-implementations"] license = "MIT/Apache-2.0" [badges] -travis-ci = { repository = "jonhoo/msql-srv" } +azure-devops = { project = "jonhoo/jonhoo", pipeline = "msql-srv", build = "27" } codecov = { repository = "jonhoo/msql-srv", branch = "master", service = "github" } maintenance = { status = "experimental" } diff --git a/README.md b/README.md index 46a5a1c..11ee122 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ [![Crates.io](https://img.shields.io/crates/v/msql_srv.svg)](https://crates.io/crates/msql_srv) [![Documentation](https://docs.rs/msql-srv/badge.svg)](https://docs.rs/msql-srv/) -[![Build Status](https://travis-ci.com/jonhoo/msql-srv.svg?branch=master)](https://travis-ci.com/jonhoo/msql-srv) +[![Build Status](https://dev.azure.com/jonhoo/jonhoo/_apis/build/status/msql-srv?branchName=master)](https://dev.azure.com/jonhoo/jonhoo/_build/latest?definitionId=27&branchName=master) [![Codecov](https://codecov.io/github/jonhoo/msql-srv/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/msql-srv) +![Maintenance](https://img.shields.io/badge/maintenance-experimental-blue.svg) Bindings for emulating a MySQL/MariaDB server. @@ -22,6 +23,7 @@ all commands with a "no results" reply: ```rust extern crate mysql; use msql_srv::*; +use mysql::prelude::*; struct Backend; impl MysqlShim for Backend { @@ -77,7 +79,7 @@ fn main() { let mut db = mysql::Conn::new(&format!("mysql://127.0.0.1:{}", port)).unwrap(); assert_eq!(db.ping(), true); - assert_eq!(db.query("SELECT a, b FROM foo").unwrap().count(), 1); + assert_eq!(db.query_iter("SELECT a, b FROM foo").unwrap().count(), 1); drop(db); jh.join().unwrap(); } diff --git a/README.tpl b/README.tpl deleted file mode 100644 index b50f8c5..0000000 --- a/README.tpl +++ /dev/null @@ -1,8 +0,0 @@ -# {{crate}}-rs - -[![Crates.io](https://img.shields.io/crates/v/msql_srv.svg)](https://crates.io/crates/msql_srv) -[![Documentation](https://docs.rs/msql-srv/badge.svg)](https://docs.rs/msql-srv/) -[![Build Status](https://travis-ci.com/jonhoo/msql-srv.svg?branch=master)](https://travis-ci.com/jonhoo/msql-srv) -[![Codecov](https://codecov.io/github/jonhoo/msql-srv/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/msql-srv) - -{{readme}} diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..2457d61 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,15 @@ +jobs: + - template: default.yml@templates + parameters: + minrust: 1.39.0 # bytes + # re-enable coverage when we're on a newer version of time: + # https://github.com/time-rs/time/pull/265 + # codecov_token: $(CODECOV_TOKEN_SECRET) + +resources: + repositories: + - repository: templates + type: github + name: crate-ci/azure-pipelines + ref: refs/heads/v0.4 + endpoint: jonhoo diff --git a/src/packet.rs b/src/packet.rs index 85a05e7..43b67ff 100644 --- a/src/packet.rs +++ b/src/packet.rs @@ -164,12 +164,10 @@ impl<'a> Packet<'a> { self.1.extend(bytes); } } else { - use std::mem; - assert!(self.1.is_empty()); let mut v = self.0.to_vec(); v.extend(bytes); - mem::replace(&mut self.1, v); + self.1 = v; self.0 = &[]; } }