Skip to content

Commit fce565f

Browse files
committed
make Swift 4 compatible
1 parent 9f31c19 commit fce565f

File tree

4 files changed

+88
-2
lines changed

4 files changed

+88
-2
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Thanks for contributing! Below are three possible templates that you can use, each separated by a line divider. It is highly recommended that you use these templates if your issue falls into one of the categories.
2+
3+
--------------------------------------------------------------------------------
4+
5+
> Use this template for bug reports. The more information you give about your issue, the faster it will get resolved!
6+
7+
# The Bug (give your bug a short name)
8+
9+
Describe the bug that you encountered in a paragraph. Include its significance and its current effects on Quark applications.
10+
11+
## Steps to reproduce
12+
13+
List the steps and/or code you used to reproduce the bug. If you cannot reproduce it, provide as much information as possible about how it occurred, what your environment is, etc.
14+
15+
## Possible solutions
16+
17+
This section is optional, but if you have any ideas for how to the bug, please do share them!
18+
19+
--------------------------------------------------------------------------------
20+
21+
> Use this template for simple enhancements that do not need a fully-fledged proposal.
22+
23+
# A simple enhancement (give your idea a descriptive name)
24+
25+
Author: [Your Name](https://github.com/Username)
26+
27+
## Description
28+
29+
Describe what your idea is. Include a few code snippets if that would be helpful.
30+
31+
## Why
32+
33+
Explain why your idea is better than what we have now. If we don't have anything like it right now, explain why it is a good idea to have it.
34+
35+
--------------------------------------------------------------------------------
36+
37+
> Use this template for enhancements that require significant consideration, design, or have a non-trivial implementation. Giving us a lot of information here will go a long way. If we accept the proposal, we will mark the issue with the label 'accepted' and assign it a milestone. If you want to work on it, assign yourself to the issue.
38+
39+
# A large feature
40+
41+
Author(s): [Your Name](https://github.com/Username)
42+
43+
## Introduction
44+
45+
A short description of what the feature is. Try to keep it to a single-paragraph "elevator pitch" so the reader understands what problem this proposal is addressing.
46+
47+
Discussed this in our [slack](http://slack.zewo.io)? Include an archive link to the conversation.
48+
49+
## Motivation
50+
51+
Describe the problems that this proposal seeks to address. If it brings in entirely new functionality, motivate why it is a good fit for the Quark ecosystem and how it betters the developer experience.
52+
53+
## Proposed solution
54+
55+
Describe your solution to the problem. Provide examples and describe how they work. Show how your solution is better than current workarounds: is it cleaner, safer, or more efficient? Include before/after code snippets if it helps.
56+
57+
## Detailed design
58+
59+
Describe the design of the solution. The detail in this section should be sufficient for someone who is _not_ one of the authors to be able to reasonably implement the feature. The more information you give here, the faster it will be implemented!
60+
61+
## Breaking changes
62+
63+
List any breaking changes that this will cause.
64+
65+
## Alternatives considered
66+
67+
Describe alternative approaches to addressing the same problem, and why you chose this approach instead.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Thanks for contributing! For small pull requests that fix things like typos, using the following template is overkill. However, if you're fixing a significant bug or implementing a feature, please do use it as it will speed up the whole process immensely.
2+
3+
--------------------------------------------------------------------------------
4+
5+
# Summary
6+
7+
Describe in a short paragraph what you have done. Include the #issue-number if this fixes an open issue.
8+
9+
- [x] Create new method `myMethod`
10+
- [x] Unit tests
11+
- [ ] Update example application to use new functionality
12+
13+
# Design decisions
14+
15+
Describe any decisions you made throughout your implementation. This section should be included if the implementation was non-trivial and required significant thought. It will help others significantly when reviewing your code.

Sources/Coroutine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public final class Coroutine {
7575
}
7676

7777
let result = co(nil, 0, &coroutine, nil, 0) { pointer in
78-
pointer?.assumingMemoryBound(to: ((Void) -> Void).self).pointee()
78+
pointer?.assumingMemoryBound(to: (() -> Void).self).pointee()
7979
}
8080

8181
guard result != -1 else {

Sources/FileDescriptor.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ public final class FileDescriptor {
134134
}
135135
}
136136

137-
buffer = buffer.suffix(from: result)
137+
#if swift(>=3.2)
138+
buffer = UnsafeRawBufferPointer(rebasing: buffer.suffix(from: result))
139+
#else
140+
buffer = buffer.suffix(from: result)
141+
#endif
138142
}
139143
}
140144

0 commit comments

Comments
 (0)