mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-06-29 01:48:42 +02:00
Compare commits
2 Commits
50415415c6
...
029de93d54
Author | SHA1 | Date | |
---|---|---|---|
|
029de93d54 | ||
|
372234b912 |
49
README.md
49
README.md
|
@ -25,3 +25,52 @@ License
|
|||
-------
|
||||
|
||||
Mozilla Public License 2 (MPL2). See the LICENSE file.
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
Dependencies should be provided by crates if you use the default features. If
|
||||
you use tokio-xmpp's `tls-native` feature you will need an ssl library
|
||||
(openssl, libressl, etc.).
|
||||
|
||||
```
|
||||
cargo build
|
||||
```
|
||||
|
||||
The various features available should be explained in the crates themselves.
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Thank you for your interest in the project!
|
||||
|
||||
We recommend you come and talk to us in the channel and/or open an issue
|
||||
before you start working on a feature, to see if it aligns with our goals.
|
||||
|
||||
The library is still in development, and while this is the case we adopt a
|
||||
fail-fast strategy, which is also a reason for the choice of the language.
|
||||
|
||||
The earlier we catch bugs and fix them, the less chances they have to confuse
|
||||
users of our library, or make end-users give up on software developed using
|
||||
this library. This also helps improving other software in the ecosystem.
|
||||
|
||||
Code changes should try to include documentation as possible. They should also
|
||||
include tests where appropriate, and pass the existing test suite.
|
||||
|
||||
CI should pass to submit your changes. This is done by ensuring `cargo fmt`
|
||||
and `cargo test` pass (in the workspace).
|
||||
|
||||
More thorough tests can be done locally with `act exec` or `forgejo-runner
|
||||
exec`, which is also what is run in the CI. We require docker to be setup for
|
||||
this to work.
|
||||
|
||||
Merge requests can contain as many commits as necessary, but commits should be
|
||||
kept rather small and meaningful (not include too many different things).
|
||||
|
||||
Do not forget to update changelogs and other crate metadata where necessary.
|
||||
|
||||
Signing commits (`git commit -S`) and adding DCO bits (`git commit -s`) are
|
||||
welcome but not mandatory.
|
||||
|
||||
We'll do our best to review and discuss changes with you but we're also humans
|
||||
with other activities, please be patient with us.
|
||||
|
|
|
@ -24,9 +24,6 @@ sha3 = "0.10"
|
|||
blake2 = "0.10.4"
|
||||
chrono = { version = "0.4.5", default-features = false, features = ["std"] }
|
||||
|
||||
[build-dependencies]
|
||||
rustc_version = "0.4"
|
||||
|
||||
[features]
|
||||
# Build xmpp-parsers to make components instead of clients.
|
||||
component = []
|
||||
|
|
|
@ -34,9 +34,6 @@ syntect = { version = "5", optional = true }
|
|||
[dev-dependencies]
|
||||
env_logger = { version = "0.10", default-features = false, features = ["auto-color", "humantime"] }
|
||||
|
||||
[build-dependencies]
|
||||
rustc_version = "0.4"
|
||||
|
||||
[features]
|
||||
default = ["tls-native"]
|
||||
tls-rust = ["tokio-rustls", "webpki-roots"]
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
use rustc_version::version;
|
||||
|
||||
fn main() {
|
||||
let version = version().unwrap();
|
||||
|
||||
for major in 1..=version.major {
|
||||
for minor in 0..=version.minor {
|
||||
println!("cargo:rustc-cfg=rustc_least_{}_{}", major, minor);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -105,28 +105,19 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
|
|||
Poll::Ready(Ok(()))
|
||||
}
|
||||
|
||||
fn start_send(
|
||||
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
|
||||
item: Packet,
|
||||
) -> Result<(), Self::Error> {
|
||||
fn start_send(mut self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> {
|
||||
Pin::new(&mut self.stream)
|
||||
.start_send(item)
|
||||
.map_err(|e| e.into())
|
||||
}
|
||||
|
||||
fn poll_flush(
|
||||
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
|
||||
cx: &mut Context,
|
||||
) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), Self::Error>> {
|
||||
Pin::new(&mut self.stream)
|
||||
.poll_flush(cx)
|
||||
.map_err(|e| e.into())
|
||||
}
|
||||
|
||||
fn poll_close(
|
||||
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
|
||||
cx: &mut Context,
|
||||
) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), Self::Error>> {
|
||||
Pin::new(&mut self.stream)
|
||||
.poll_close(cx)
|
||||
.map_err(|e| e.into())
|
||||
|
@ -137,10 +128,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
|
|||
impl<S: AsyncRead + AsyncWrite + Unpin> Stream for XMPPStream<S> {
|
||||
type Item = Result<Packet, crate::Error>;
|
||||
|
||||
fn poll_next(
|
||||
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
|
||||
cx: &mut Context,
|
||||
) -> Poll<Option<Self::Item>> {
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
Pin::new(&mut self.stream)
|
||||
.poll_next(cx)
|
||||
.map(|result| result.map(|result| result.map_err(|e| e.into())))
|
||||
|
|
Loading…
Reference in New Issue
Block a user